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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Manually setting width on columns produces inconsistent results

Thread ID:





49830 Sep 28,2006 05:12 AM UTC Sep 29,2006 05:12 AM UTC WinForms 3
Tags: Grouping
Asked On September 28, 2006 05:12 AM UTC

I am trying to set specific column width when the ggc load (using the code snippet below) and make specific column non-resizable. However, the ggc produces unexpected result. The column width are no where near what are set and are even out of proportion. Am i using the wrong calls?
this.gridGroupingControl.TableModel.ColWidths["Rate"] = 70; this.gridGroupingControl.TableModel.ColWidths["Total"] = 100;

Administrator [Syncfusion]
Replied On September 28, 2006 08:59 AM UTC

Hi James,

For Resizable columns :

To change the individual column width manually,You could try this code snippet:

this.gridGroupingControl1.TableDescriptor.Columns["parentID"].Width = 175;

//For paticular table.

For Non Resizable columns :

You can handle the QueryColWidth event and set the width of the fixed column. Below is a code snippet.

private void TableModel_QueryColWidth(object sender, GridRowColSizeEventArgs e)
GridTableModel model = sender as GridTableModel;
GridTableDescriptor td = model.Table.TableDescriptor;
int index = model.ColIndexToField(e.Index);

if( index != -1 && td.VisibleColumns.Count > index )
string ColName = td.VisibleColumns[index].Name;

if( ColName == "ParentName")
e.Size = 20;
e.Handled = true;


Replied On September 28, 2006 05:14 PM UTC

Neither of the code below is working. When the grid load, the columns are all squished up!

this.gridGroupingControl.TableModel.ColWidths["col"] = 70;

this.gridGroupingControl.TableDescriptor.Columns["col"].Width = 175;

Administrator [Syncfusion]
Replied On September 29, 2006 05:12 AM UTC

Hi James,

Sorry for the inconvenience caused.

If you can upload a sample showing the problem or tell us how to see the problem in one of the browser samples we ship, we can try to resolve the problem.

Thanks for your patience.

Best Regards,


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