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

Resizing Columns

Thread ID:

Created:

Updated:

Platform:

Replies:

23000 Dec 31,2004 11:23 AM Jan 3,2005 10:59 AM Windows Forms 3
loading
Tags: GridControl
Anthony Avella
Asked On December 31, 2004 11:23 AM

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 03:31 PM

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

Anthony Avella
Replied On January 3, 2005 10:04 AM

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 10:59 AM

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.

CONFIRMATION

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.

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.

;