Submitted by DavidF on 2016/05/10 16:45
hi,
 
I'm trying to set a column font to be fixed-width so i can enter code... I've had a look at this thread: http://www.sqlnotes.net/drupal5/index.php?q=node/3172, which is mainly about column colour but it's a similar idea. I gather from this thread it isn't straightforward but It seems you can do it via Grid Properties, however I can't work it out. There's a box where you can set "default font", and then another box where you can choose what field(s) you can apply "item font" to. I'm just not clear on what's going on here. Default font is the font for the whole grid, right? And "item font" is just whatever the font for a particular item is??
 
Also, while I'm in Grid Properties, I notice something I think I've mentioned before, which is that the settings here don't seem to "stick". Eg I wanted this grid to always show the Source Bar, so I checked it, but the Source Bar doesn't show. I saved Grid Properties and I saved the grid itself, closed the grid, reopened - no source bar. The odd thing is, in the Grid Menu, Source Bar is highlighted as if it were being displayed - but it isn't.
 
David F.

Comments

... just to update, I managed to get what I wanted via conditional formatting: ItemFont = "consolas". Good stuff. I can see me using condtional formatting a lot...
 
Would still be curious to know about the Grid Properties issues though.
 
-- David F.

Pierre_Admin

2016/05/10 17:25

In reply to by DavidF

Great ! Do you mind showing us the details ?
 
Pierre_Admin
IQ Designer
 

Hi David,
 
You're on the right track !
IQ is not very flexible when it comes to having different fonts in different columns. It can be achieved though by using the Grid properties Item Font applies to, as found. Enter your field name which contains the code. Then, for all items that have code, select the item format to be a fixed-width font
 
Regarding the source bar, do Grid > Source bar. For your safety, the source bar is never shown when you open the grid, you need to open it. It will stay open however on grid refresh
 
 
Pierre_Admin
IQ Designer
 

DavidF

2016/05/10 18:06

In reply to by Pierre_Admin

OK, still not getting this, on both fronts I'm afraid, conditional formatting and Grid Properties.
 
Conditional formatting
 
So, I have a field, Code, whose font is to be Consolas. I put ItemFont = "consolas" in the Conditional Formatting Box for that field. This makes the font in the Code field consolas, great; but it's only that one item. And the whole item has gone Consolas, not just that field. I go to the next item in the grid, type something in the Code column, it's the regular default font. Shouldn't the conditional formatting work only in the specified field, and across all items?
 
Grid Properties
 
Sorry Pierre, I don't get what the settings here should be. Here is what I assume is me doing it wrong:
 
 
All I've done here of course is changed the font for the whole grid to Consolas.
 
I don't see how I connect the field "Code" to a specific font I want it to be.
 
Also, a related issue - the item I manually changed back to Verdana (my IQ default for grids) is now "immune" to changes to the defaults, either at IQ or Grid level. Is there any way you can reset these items so they go back to changing when the default changes?
 
-- David F.

Pierre_Admin

2016/05/10 18:16

In reply to by DavidF

  1. Conditional formatting: It should not work with the current version. I'm trying to get this to work for v77
  2. Grid Item font setting: 
    1. First delete the default font (Consolas|9|)
    2. Close the grid and re-open
    3. select all items that have code and set the Item Font to Consolas. Only the Code column should show the Consolas font
 
 
Pierre_Admin
IQ Designer
 

DavidF

2016/05/10 18:27

In reply to by Pierre_Admin

OK, got it now! You're not really setting a column font as such, you're saying, "If I manually set the font for a whole item or items to be such-and-such, make this affect only the specified column." I got there in the end!.
 
It's not completely what I was looking for but will do fine until v77 and conditional formatting...
 
thanks Pierre.
 
David F.
 

Pierre_Admin

2016/05/10 18:44

In reply to by DavidF

This will work in v77:
 
 
Pierre_Admin
IQ Designer
 

Tom

2016/05/11 04:40

In reply to by Pierre_Admin

[quote=Pierre_Admin]
This will work in v77:
 
 
[/quote]very nice Pierre :thumbsup: