Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index) +7602287 Telerik.Web.UI.GridGroupByExpressionCollection.get_Item(Int32 index) +48 <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false"> <MasterTableView> <GroupByExpressions> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField FieldName="Group1" ></telerik:GridGroupByField> <telerik:GridGroupByField FieldName="Group2" ></telerik:GridGroupByField> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="Group1" SortOrder="Descending"></telerik:GridGroupByField> <telerik:GridGroupByField FieldName="Group2" SortOrder="Descending"></telerik:GridGroupByField> </GroupByFields> </telerik:GridGroupByExpression> </GroupByExpressions> <Columns> <telerik:GridBoundColumn DataField="Group1" HeaderText="1" ></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Group2" HeaderText="2" ></telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid>Partial Class TestArea_Test Inherits System.Web.UI.Page Protected Sub RadGrid1_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource Dim result As New List(Of Test) result.Add(New Test("first", "second")) RadGrid1.DataSource = result End Sub Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load RadGrid1.Rebind() End SubEnd Class Class Test Private _Group1 As String Private _Group2 As String Public Sub New(ByVal g1 As String, ByVal g2 As String) Group1 = g1 Group2 = g2 End Sub Public Property Group1 As String Get Return _Group1 End Get Set(value As String) _Group1 = value End Set End Property Public Property Group2 As String Get Return _Group2 End Get Set(value As String) _Group2 = value End Set End PropertyEnd Class
my form source <table> <tr> <td class="RC1" style="width:10%;"> <asp:Label ID="lblCountry" runat="server" ></asp:Label> </td> <td style="width:90%;" class="RC2"> <telerik:RadComboBox ID="lstCountries" Runat="server" Width="200px" Filter="StartsWith" onclientdropdownopening="DropDownOpening" ValidationGroup="ValAddressInfo" OnClientSelectedIndexChanged="loadStates"> </telerik:RadComboBox> <asp:RequiredFieldValidator ID="reqCountry" runat="server" ControlToValidate="lstCountries" CssClass="Validator" ValidationGroup="ValAddressInfo">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td class="RC1" style="width:20%;" > <asp:Label ID="lblStates" runat="server" ></asp:Label> </td> <td class="RC2" style="width:80%;"> <telerik:RadComboBox ID="lstStates" Runat="server" Width="200px" Filter="StartsWith" onclientdropdownopening="DropDownOpening" OnClientSelectedIndexChanged="loadCities" onitemsrequested="lstStates_ItemsRequested" OnClientItemsRequesting="statesItemRequesting" EnableLoadOnDemand ="true" > <CollapseAnimation Type="OutQuint" Duration="200" /> </telerik:RadComboBox> </tr> <tr> <td class="RC1" style="width:20%;"> <asp:Label ID="lblCities" runat="server" ></asp:Label> </td> <td class="RC2" style="width:80%;"> <telerik:RadComboBox ID="lstCities" Runat="server" Width="200px" Filter="StartsWith" onclientdropdownopening="DropDownOpening" onitemsrequested="lstCities_ItemsRequested" OnClientItemsRequesting="citiesItemRequesting" EnableLoadOnDemand ="true" > </telerik:RadComboBox> </td> </tr> </table> <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> <script type="text/javascript" language="javascript"> function loadStates(sender, args) { var listStates = $find("<%=lstStates.ClientID %>"); var item = args.get_item(); if (item.get_index() > 0) { listStates.requestItems(item.get_value(), false); } else { } } function statesItemRequesting(sender, args) { var lst1 = $find("<%=lstCountries.ClientID %>"); var context = args.get_context(); context["country_code"] = lst1.get_selectedItem().get_value(); } function loadCities(sender, args) { var listCities = $find("<%=lstCities.ClientID %>"); var item = args.get_item(); if (item.get_index() > 0) { listCities.requestItems(item.get_value(), false); } else { } } function citiesItemRequesting(sender, args) { var lst1 = $find("<%=lstCountries.ClientID %>"); var lst2 = $find("<%=lstStates.ClientID %>"); var context = args.get_context(); context["country_code"] = lst1.get_selectedItem().get_value(); context["state_code"] = lst2.get_selectedItem().get_value(); } </script> </telerik:RadScriptBlock>in the code behind protected void lstStates_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) { int iCountryCode = Convert.ToInt32(Convert.ToInt32(e.Context["country_code"])); bindList(iCountryCode,0,lstStates,2); } protected void lstCities_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) { int iCountryCode = Convert.ToInt32(Convert.ToInt32(e.Context["country_code"])); int iStateCode = Convert.ToInt32(Convert.ToInt32(e.Context["state_code"])); bindList(iCountryCode, iStateCode, lstCities, 3); } / CommandName="Cancel"<td align="left" colspan="3"> <asp:ImageButton ID="btnInsert" runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' ImageUrl="~/Images/Update.gif" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' ToolTip="Save To Grid" ValidationGroup="ValDecision" /> <asp:ImageButton ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="~/Images/Cancel.gif" ToolTip="Cancel" /></td>Hello Techies,
I am new to this forum. This is Sree. I work on SharePoint 2010.
We developed a user controls which queries the data from SharePoint library and bind the result into RadGrid.
Here the problem is when search query returns more than 15000 records; it takes too much time to bind the result into RadGrid and finally end up with timeout error (attached snapshot). Sometimes the page gets hung and the only option we have is to close the browser.
Is there any recommended item limit for RadGrid to avoid these issues?
As per my requirement my search query always returns more than 20000 records(may increase to a lack in future) and I can’t suggest users to put more refinement to get few results so that I can avoid these problems.
I certainly need your valuable advice's on this to overcome such scenarios?
Thanks in advance
Sree
OnClientItemsRequested event.
Now I want remove one or many items form the combobox. So I wrote code on client blur event.var errItem = new Telerik.Web.UI.RadComboBoxItem();
errItem = sender.findItemByText("ABCD")
if (errItem) {
sender.clearSelection();
sender.clearItems();
sender.trackChanges();
sender.get_items().remove(errItem);
sender.commitChanges();
}
errItem = sender.findItemByText("XYZ")
if (errItem) {
sender.clearSelection();
sender.clearItems();
sender.trackChanges();
sender.get_items().remove(errItem);
sender.commitChanges();
}