ADAdministrator Syncfusion Team December 31, 2004 03:31 PM
You can use the TableDescriptor.Columns[..].Width property.
this.gridGroupingControl1.TableDescriptor.Columns["Col1"].Width = 200;
AAAnthony AvellaJanuary 3, 2005 10:04 AM
Now, I have two questions about cell fonts:
1- If you add the grid to your GUI at design time, you can set 3 different font properties - font style (bold, italic, etc...), font size and the actual font itself (Arial, Sans Serif, etc...). Since I''m creating the grid programatically, I need to set these font properties programatically. I''m able to set the first two, but I cannot set the third. How do I do this?
2- I''m trying to set the above mentioned properties for my whole grouping grid as well - both summary and detail cells.
If I use the following lines of code during grid initialization, the desired settings do not appear in the grid:
grid.Appearance.GroupCaptionSummaryCell.Font.Size = 8;
grid.Appearance.GroupCaptionSummaryCell.Font.Bold = false;
grid.Appearance.GroupCaptionCell.Font.Size = 8;
grid.Appearance.GroupCaptionCell.Font.Bold = false;
grid.Appearance.RecordFieldCell.Font.Size = 8;
grid.Appearance.RecordFieldCell.Font.Bold = false;
But, if I use the following lines of code in the QueryCellStyleInfo event handler, the desired results do appear in the grid:
e.Style.Font.Size = 8;
e.Style.Font.Bold = false;
Is there any way I can use the first method so I can avoid using the second one and calling those two lines of code with every cell?
ADAdministrator Syncfusion Team January 3, 2005 10:59 AM
1) try setting the Font.Facename property.
2) grid.Appearance.RecordFieldCell is only every other record line. So, you would also have to set grid.Appearance.AlternateRecordFieldCell as well. If the appropriate Appearances are set, then you should not have to set the styles again in QueryCellStyleInfo unless you want to override the initial Appearance settings.