I have a grid, and I have the OnColumnResized client event wired up. My problem is that it appears to be firing way too much. I expected this to fire after the column is done being resized, but it appears to fire continuously, identical to the behavior of OnColumnResizing.
Here is my javascript function:
| <script language="javascript" type="text/javascript"> |
| function ColumnResized(sender, eventArgs) |
| { |
| var columnIndex = eventArgs.get_gridColumn().get_element().cellIndex; |
| var newWidth = eventArgs.get_gridColumn().get_element().offsetWidth; |
| $("#<%= txtIndex.ClientID %>").val(columnIndex); |
| $("#<%= txtWidth.ClientID %>").val(newWidth); |
| } |
| </script> |
All I am doing at this point is updating some textboxes with jQuery after the event. Here is my grid definition:
| <telerik:RadGrid ID="radGrid" runat="server" ShowHeader="true" Width="100%" GridLines="Both"> |
| <ClientSettings> |
| <Resizing AllowColumnResize="true" AllowRowResize="false" ResizeGridOnColumnResize="false" EnableRealTimeResize="true" /> |
| <ClientEvents OnColumnResized="ColumnResized" OnColumnResizing="ColumnResizing" /> |
| </ClientSettings> |
| <HeaderStyle HorizontalAlign="center" /> |
| <ItemStyle HorizontalAlign="center" /> |
| </telerik:RadGrid> |
The columns are being set up in the code-behind. When I run this, The textboxes constantly update as I am resizing the column, where I expected the value to update only once, when I stop dragging the column. Can anyone tell me why this is happening?