We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Resizing Columns

I''m using version 3... of your grid (grid grouping control). How do I programatically resize the columns of the grid? thanks.

3 Replies

AD Administrator Syncfusion Team December 31, 2004 08:31 PM UTC

You can use the TableDescriptor.Columns[..].Width property. this.gridGroupingControl1.TableDescriptor.Columns["Col1"].Width = 200;


AA Anthony Avella January 3, 2005 03:04 PM UTC

Thanks. 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? Thanks.


AD Administrator Syncfusion Team January 3, 2005 03:59 PM UTC

1) try setting the Font.Facename property. grid.Appearance.RecordFieldCell.Font.Facename 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.

Loader.
Live Chat Icon For mobile
Up arrow icon