I have a RadGrid:
<telerik:RadGridID="radgridMachines"runat="server" AllowSorting="True" AllowMultiRowSelection="true" AutoGenerateColumns="False" OnNeedDataSource="radgridMachines_NeedDataSource" OnItemDataBound="radgridMachines_ItemDataBound" EnableViewState="false"> <ClientSettingsEnablePostBackOnRowClick="false"> <SelectingAllowRowSelect="true"UseClientSelectColumnOnly="true"/> <ScrollingAllowScroll="true"UseStaticHeaders="true"/> <ResizingAllowColumnResize="true"ResizeGridOnColumnResize="true"AllowResizeToFit="true"/> <ClientEventsOnGridCreated="SelectAndResizeAllRows"OnRowSelected="TogglePrintControls"OnRowDeselected="TogglePrintControls"/> </ClientSettings> <GroupingSettingsCaseSensitive="false"/> <SortingSettings/> <MasterTableViewDataKeyNames="CustomerID, CustomerName, PlantNumber, Route, MachineNumber, PlantName, MachineName, CustomerEquipmentID, TestPackage, PointID, Lubricant" ClientDataKeyNames="" AllowMultiColumnSorting="true"> <Columns> <%--Fit to Contents--%> <telerik:GridBoundColumnUniqueName="CustomerNumber"DataField="CustomerID"DataType="System.Int32"HeaderText="Cust #"HeaderStyle-Width="60px"></telerik:GridBoundColumn> <telerik:GridBoundColumnUniqueName="PlantNumber"DataField="PlantNumber"DataType="System.Int32"HeaderText="Plant #"HeaderStyle-Width="60px"></telerik:GridBoundColumn> <telerik:GridBoundColumnUniqueName="MachineNumber"DataField="MachineNumber"DataType="System.Int32"HeaderText="Mach #"HeaderStyle-Width="60px"></telerik:GridBoundColumn> <telerik:GridClientSelectColumnUniqueName="SelectColumn"ItemStyle-HorizontalAlign="Center"HeaderStyle-HorizontalAlign="Center"HeaderStyle-Width="60px"/> <%--Fit to Contents--%> <telerik:GridBoundColumnUniqueName="RouteNumber"DataField="Route"HeaderText="Route"ItemStyle-HorizontalAlign="Center"HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn> <telerik:GridBoundColumnUniqueName="PlantName"DataField="PlantName"HeaderText="Plant Name"ItemStyle-HorizontalAlign="Center"HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn> <telerik:GridBoundColumnUniqueName="MachineName"DataField="MachineName"HeaderText="Machine Name"ItemStyle-HorizontalAlign="Center"HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn> <telerik:GridBoundColumnUniqueName="CustomerEquipmentID"DataField="CustomerEquipmentID"HeaderText="Machine ID"ItemStyle-HorizontalAlign="Center"HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn> <telerik:GridBoundColumnUniqueName="TestPackage"DataField="TestPackage"HeaderText="Test Package"ItemStyle-HorizontalAlign="Center"HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn> <telerik:GridBoundColumnDataField="PointID"Visible="false"></telerik:GridBoundColumn> </Columns> </MasterTableView></telerik:RadGrid>When I load 2600 rows, the browser gives me the following error:
"A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue. Script: http://localhost:50820/ScriptR…8-VKUfdnFfZq18eaxA2&t=7c776dc1:652"
The OnGridCreated event looks like this:
functionSelectAndResizeAllRows(sender, eventArgs) { varrows = $find('<%= radgridMachines.ClientID%>').get_masterTableView().get_dataItems(); for(vari = 0; i < rows.length; i++) { rows[i].set_selected(true); } vargrid = $find("<%= radgridMachines.ClientID %>"); varcolumns = grid.get_masterTableView().get_columns(); for(vari = 0; i < 4; i++) { //columns.length columns[i].resizeToFit(false, true); }}
If I remove the first for loop, the grid loads properly. But I need to support selecting all rows. Is there another way to accomplish this? Why can't the grid handle this?
Thanks









