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.

Filling columns to the size of the control

Thread ID:

Created:

Updated:

Platform:

Replies:

73359 May 2,2008 04:04 PM May 6,2008 03:00 AM Windows Forms 1
loading
Tags: GridControl
Adam
Asked On May 2, 2008 04:04 PM

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.


Administrator [Syncfusion]
Replied On May 6, 2008 03:00 AM

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.



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.

;