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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Resizing Columns

Thread ID:





23000 Dec 31,2004 04:23 PM UTC Jan 3,2005 03:59 PM UTC WinForms 3
Tags: GridControl
Anthony Avella
Asked On December 31, 2004 04:23 PM UTC

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

Administrator [Syncfusion]
Replied On December 31, 2004 08:31 PM UTC

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

Anthony Avella
Replied On 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.

Administrator [Syncfusion]
Replied On 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.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon