This is a migrated thread and some comments may be shown as answers.

OnColumnResizing bug

3 Answers 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brad Divine
Top achievements
Rank 1
Brad Divine asked on 22 Jul 2010, 11:56 PM
Hi,

According to the documentation, OnColumnResizing should be passed a column index and a width
(http://www.telerik.com/help/aspnet-ajax/grid_oncolumnresizing.html)

However, the example provided uses sender and eventArgs, and the example demonstrates how to find the current width of the column, not the new value that should be assigned.  How do I get the new width?

Thanks,
Brad

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 23 Jul 2010, 08:30 AM
Hello Brad,

You can extract the new width for the resized column wiring the OnColumnResized client event. This event is fired right after you resize a grid column on the client.

Best regards,
Sebastian
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Brad Divine
Top achievements
Rank 1
answered on 23 Jul 2010, 04:05 PM
At that point it's too late; I can't cancel the resize event. Since ClipCellContentOnResize=false appears to do nothing in either IE or Chrome, I need to check the new width against some minimum size and cancel if it's too small.

Or, ideally, set the width to the max of the new width or my minimum size. Any way to do that?

Thanks,
Brad
0
Sebastian
Telerik team
answered on 26 Jul 2010, 12:49 PM
Hello Brad,

To implement no wrap for grid cell content, consider setting DataFormatString with nobr tags as presented on this online demo of the product:

http://demos.telerik.com/aspnet-ajax/grid/examples/client/resizing/defaultcs.aspx (see the relevant option from the configurator)

When you set EnableRealTimeResize = true for the grid, the OnColumnResizing event will be raised each time you change the column widths even with 1 pixel, while with EnableRealTimeResize = false the event will be fired when you release the mouse only.

Unfortunately there is no possible means to calculate properly the new width of the column inside the OnColumnResizing event handler. That is why as a possible workaround you may consider setting min or max width using the offsetWidth attribute of the column inside the OnColumnResized event. I hope this is feasible solution for your case.

Kind regards,
Sebastian
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Brad Divine
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Brad Divine
Top achievements
Rank 1
Share this question
or