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
close icon

Filling columns to the size of the control

Is it possible to to have the column widths automatically grow as the size of the control increases, perhaps with a fillweight to determine how much each column grows?

I'm using 4.2.0.37

On a completely unrelated note, I name column header in code. If I select the entire column, it will replace my header text with the default "A". This only occurs on the first column. Any suggestions.


1 Reply

AD Administrator Syncfusion Team May 6, 2008 07:00 AM UTC

Hi Adam,

Thanks for the interest in Syncfusion products.

#1.You can use the ResizeToFit method and can make the widths of the column automatically grow as the size of the text of control increase. Please refer the following code snippet that shows how we can set ResizeToFit.


this.gridControl1.ColWidths.ResizeToFit(GridRangeInfo.Cols(1,5));


#2. Please try setting the header of the text as following code.


this.gridControl1[0, 1].Text = "This is Header";


Please refer the following sample that illustrates the #1 and #2.

http://websamples.syncfusion.com/samples/Grid.Windows/F73359/main.htm

If you still find the #2 issue (replace the text with "A") in the above sample, could you please try to reproduce the issue in this sample so that we could sort out the cause of the issue and provide you a solution?

Please let me know if you have any questions.
Regards,
Asem.



Loader.
Live Chat Icon For mobile
Up arrow icon