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

Need to Change Column Size at runtime...

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.

1 Reply

AD Administrator Syncfusion Team August 23, 2006 09:59 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon