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.

Need to Change Column Size at runtime...

Thread ID:

Created:

Updated:

Platform:

Replies:

48242 Aug 23,2006 05:27 AM Aug 23,2006 05:59 AM Windows Forms 1
loading
Tags: GridControl
Sathish Chandran
Asked On August 23, 2006 05:27 AM

Hi,

At the time of initialization of my grid, I''m specifying the column size for each column in the below handler.

QueryColWidth += new GridRowColSizeEventHandler(grid_QueryColWidth);

I want to change the column size based on the cell value assinged at the run time. If no value has been assinged to the cell then the column should go with the column size which has been specified at the time of initialization in the above handler.

Please help me out.

Thanks & Regards,
Sathish.

Administrator [Syncfusion]
Replied On August 23, 2006 05:59 AM

Hi Sathish,

To resize the width of the column to fit the size of the text, you need to call the ResizeToFit method . Below is a code snippet.

grid.Model.ColWidths.ResizeToFit(GridRangeInfo.Col(ColIndex));

Here is a sample for implementing it.
http://www.syncfusion.com/Support/user/uploads/GridColWidth_40f0354a.zip

Let me know if you are looking something different.

Best Regards,
Haneef

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.

;