I'm getting an IndexOutOfRangeException when paging a WebDataGrid. The grid loads data and allows me to page to the second page without issue. If I attempt to page back to the first page, I get the following:
Markup for the grid is below. The grid pulls the data through a SqlDataSource object.
<ig:WebDataGrid ID="wdgIncomeTransactions" runat="server" Height="435px" Width="99%" AutoGenerateColumns="False" StyleSetName="Windows7" EnableDataViewState="True" ViewStateMode="Enabled"> <Behaviors> <ig:Sorting Enabled="true" SortingMode="Single" /> <ig:Paging Enabled="true" PagerMode="NumericFirstLast" PageSize="50" /> <ig:ColumnResizing Enabled="true" /> <ig:Filtering Enabled="true" Visibility="Visible" /> <ig:SummaryRow Enabled="false" EmptyFooterText="no results"> </ig:SummaryRow> </Behaviors> <Columns> <ig:TemplateDataField Key="TransactionId" Width="50px"> <ItemTemplate> <a href="NewTransaction.aspx?transactionId=<%# DataBinder.Eval(Container, "DataItem.TransactionId") %>"> <%# DataBinder.Eval(Container, "DataItem.TransactionId")%></a> </ItemTemplate> <Header Text="Id" /> </ig:TemplateDataField> <ig:TemplateDataField Key="TransactionIdExport" Width="50px" Hidden="true"> <ItemTemplate> <%# DataBinder.Eval(Container, "DataItem.TransactionId")%> </ItemTemplate> <Header Text="Id" /> </ig:TemplateDataField> <ig:TemplateDataField Key="Status" Width="50px"> <ItemTemplate> <%# DataBinder.Eval(Container, "DataItem.Status") %> </ItemTemplate> <Header Text="Status" /> </ig:TemplateDataField> <ig:BoundDataField DataFieldName="Description" Key="Description" Footer-CssClass="accountingColumn" Width="100px"> <Header Text="Description" /> <Footer CssClass="accountingColumn"></Footer> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Investment Type" Key="Investment Type" Footer-CssClass="accountingColumn" Width="50px"> <Header Text="Type" /> <Footer CssClass="accountingColumn"></Footer> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Owner" Key="Owner" Footer-CssClass="accountingColumn"> <Header Text="Owner" /> <Footer CssClass="accountingColumn"></Footer> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Investment" Key="Investment" Footer-CssClass="accountingColumn"> <Header Text="Investment" /> <Footer CssClass="accountingColumn"></Footer> </ig:BoundDataField> <ig:BoundDataField DataFieldName="NaturalAmount" DataFormatString="{0:c}" Width="100px" DataType="System.Decimal" Key="NaturalAmount" CssClass="accountingColumn"> <Header Text="Amount" CssClass="accountingColumn" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="DR" Key="DR"> <Header Text="Debit Account" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="CR" Key="CR"> <Header Text="Credit Account" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="BatchNumber" Key="BatchNumber" Width="25px"> <Header Text="Batch" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Effective Date" DataType="System.DateTime" Width="75px" Key="Effective Date"> <Header Text="Effective" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Allocated Date" DataType="System.DateTime" Width="75px" Key="Allocated Date"> <Header Text="Allocated" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="AddedBy" Width="75px" Key="AddedBy"> <Header Text="User" /> </ig:BoundDataField> </Columns></ig:WebDataGrid>
Ok, apparently you can't post images. The error is an IndexOutOfRangeException. Here's the first part of the error message:
Async request failed
[IndexOutOfRangeException]: Index was outside the bounds of the array.
at
Infragistics.Web.UI.GridControls.SummaryRow.LoadClientObjects(Object[] objects)
Hello Eric,
I have tested this scenario but am so far unable to replicate the behavior in question. Attached is my test sample for your reference. I've noticed that you have DataViewState enabled, which assuming that the grid is bound to an SqlDataSource would not improve the performance of the grid (the records would be placed in the viewstate, however since the grid is rebound on each postback no benefit is gained). I suggest checking whether disabling DataViewState makes a difference.
In order to allow me to examine this matter further, a working sample demonstrating the behavior would be greatly appreciated.
Please feel free to contact me if you are still experiencing issues with this scenario.