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

How auto size columns

Thread ID:





132127 Aug 15,2017 07:39 PM UTC Aug 18,2017 06:45 AM UTC WinForms 3
Tags: GridGroupingControl
Ricardo Esteban Veloz Granados
Asked On August 15, 2017 07:39 PM UTC

Hi, some body know, how autosize columns, to show all cell content without change the row height

Arulpriya Ramalingam [Syncfusion]
Replied On August 16, 2017 10:11 AM UTC

Hi Ricardo,   
Thanks for using Syncfusion products.   
Suggestion 1   
In order to resize the column width based on length of the cell value, the AutoSize property of GridStyleInfo can be set to true and the WrapText property of GridStyleInfo can be set to flase. Please make use of below code and sample,   
Code example:  
//To resize the column based on length of cell value   
this.gridGroupingControl1.AllowProportionalColumnSizing = false;   
this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.AutoSize = true;   
this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.WrapText = false;    
Suggestion 2   
The QueryCellStyleInfo event can also be used to resize the column width based on length of the cell value. In that event, the AutoSize and WrapText properties can be used. Please refer to the below code,   
Code example  
this.gridGroupingControl1.QueryCellStyleInfo += GridGroupingControl1_QueryCellStyleInfo;   
private void GridGroupingControl1_QueryCellStyleInfo(object sender,GridTableCellStyleInfoEventArgs e)   
    e.Style.AutoSize = true;   
    e.Style.WrapText = false;   
Suggestion 3   
The ResizeToFit() method of GridModelRowColIndexer can also be used to resize the column width based on length of the cell value. Please refer to the below code,   
Code example   
//To resize the column based on length of cell value   
The AllowProportionalColumnSizing property should be set to false  

Ricardo Esteban Veloz Granados
Replied On August 17, 2017 05:35 PM UTC

Thanks, its help me and is the solution to what I was looking for, only one cuestion more

Through designer is possible to change this property ?

this.gridGroupingControl1.AllowProportionalColumnSizing = false;

Arulpriya Ramalingam [Syncfusion]
Replied On August 18, 2017 06:45 AM UTC

Hi Ricardo,   
Thanks for your update.   
We could understand your scenario. We regret to let you know that the GridGroupingControl does not have support for setting theAllowProportionalColumnSizing in designer. As we updated earlier, the AllowProportionalColumnSizing can be set programmatically. Please make use of below UG link,   
Please let us know if you have any other queries.   


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

or the page will be automatically redirected to 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