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.
Syncfusion Feedback

How to automatically adjust the column width based on the contents, using GridGroupingControl ?

Thread ID:

Created:

Updated:

Platform:

Replies:

124097 May 17,2016 05:46 AM UTC May 18,2016 11:41 AM UTC Windows Forms 3
loading
Tags: GridGroupingControl
TrySyncfusion
Asked On May 17, 2016 05:46 AM UTC

Hi,

How to automatically adjust the column width based on the contents, using GridGroupingControl ?

It can be done in Visual Studio's DataGridView by setting the attribute AutoSizeColumnMode to DisplayedCells,
Is there a similar way in GridGroupingControl?

thanks :)

Anish George [Syncfusion]
Replied On May 17, 2016 06:56 AM UTC

Hi TrySyncfusion, 
 
Thank you for using Syncfusion products. 
  
Please try using the ColWidths.ResizeToFit method to achieve the auto size behavior in GridGroupingControl. Refer the below code snippet. 

C#: 
// Resize the width of the 2nd column according to the contents in it. 
this.gridGroupingControl1.TableModel.ColWidths.ResizeToFit(GridRangeInfo.Col(2), GridResizeToFitOptions.IncludeHeaders); 



Please let us know is you need any further assistance. 

Regards, 
Anish. 


TrySyncfusion
Replied On May 18, 2016 02:48 AM UTC

It works, thanks a lot. ^_^  

Anish George [Syncfusion]
Replied On May 18, 2016 11:41 AM UTC

Hi TrySyncfusion, 
  
We are glad to hear that the given suggestion meets your requirement. 
  
Please let us know if you need any further assistance. 
  
Regards,
Anish 


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.

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

;