I'm using one WebHierarchicalDataGrid on my page. When page is postback around 5-6 times, I am getting below mentioned error:
----------------------Begin-------------------------------------
[IndexOutOfRangeException: Index was outside the bounds of the array.] Infragistics.Web.UI.GridControls.GridBot.LoadClientCollections(Object[] collections) +2165 Infragistics.Web.UI.Framework.RunBot.LoadClientData() +43 Infragistics.Web.UI.Framework.RunBot.HandleLoadPostData(String postDataKey, NameValueCollection postCollection) +25 Infragistics.Web.UI.GridControls.ContainerGrid.LoadPostData(String postDataKey, NameValueCollection postCollection) +80 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +1068 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3406
----------------------End-------------------------------------
I'm wondering if this error occurs because my WebHierarchicalDataGrid is too big, or are there any possibilities to cause this problem?
Below is the code defination:
---------------------Begin---------------------------------------
<igtbl:WebHierarchicalDataGrid ID="DEPA" runat="server" AutoGenerateColumns="false" AutoGenerateBands="false" DataKeyFields="ID" EnableDataViewState="true" InitialDataBindDepth="-1" Width="99%" EnableAjax="false" Key="PARTICIPANTS"> <ClientEvents Initialize="DEPA_Initialize" /> <Columns> <igtbl:BoundDataField Key="ID" DataFieldName="ID" Hidden="true"></igtbl:BoundDataField> <igtbl:BoundDataField Key="TYPEDESC" DataFieldName="TYPEDESC" Width="70%"></igtbl:BoundDataField> <igtbl:TemplateDataField Key="ADDSTD"> <ItemTemplate> <asp:LinkButton ID="lnkAddStudent" runat="server" Text="Add" CssClass="HyperLink_Text" Width="10%"></asp:LinkButton> </ItemTemplate> </igtbl:TemplateDataField> <igtbl:TemplateDataField Key="ADDSTFF"> <ItemTemplate> <asp:LinkButton ID="lnkAddStaff" runat="server" Text="Add Staff" CssClass="HyperLink_Text" Width="10%"></asp:LinkButton> </ItemTemplate> </igtbl:TemplateDataField> <igtbl:TemplateDataField Key="ADDVSTR"> <ItemTemplate> <asp:LinkButton ID="lnkAddVisitor" runat="server" Text="Add Visitor" CssClass="HyperLink_Text" Width="10%"></asp:LinkButton> </ItemTemplate> </igtbl:TemplateDataField> </Columns> <Bands> <igtbl:Band Key="OFFENDERS" AutoGenerateColumns="false" DataKeyFields="ID,IncidentId,StudentId"> <Columns> <igtbl:TemplateDataField Key="View" Width="20px"> <ItemTemplate> <asp:ImageButton ID="btnView" runat="server" CommandArgument="OFFENDERS" OnCommand="btnView_Command" ImageUrl="~/Images/Icons/Zoom16.gif" /> </ItemTemplate> </igtbl:TemplateDataField> <igtbl:TemplateDataField Key="Edit" Width="20px"> <ItemTemplate> <asp:ImageButton ID="btnEdit" runat="server" CommandArgument="OFFENDERS" OnCommand="btnEdit_Command" ImageUrl="~/Images/Icons/Edit16.gif" /> </ItemTemplate> </igtbl:TemplateDataField> <igtbl:BoundDataField Key="STUDENTNAME" DataFieldName="STUDENTNAME" Width="90%"></igtbl:BoundDataField> <igtbl:BoundDataField Key="GRADE" DataFieldName="GRADE" Width="10%"></igtbl:BoundDataField> <igtbl:TemplateDataField Key="Delete" Width="20px"> <ItemTemplate> <asp:ImageButton ID="btnDelete" runat="server" CommandArgument="OFFENDERS" OnCommand="btnDelete_Command" ImageUrl="~/Images/Icons/Delete16.gif" ToolTip="Delete" OnClientClick="return confirm('Are you sure you want to delete this record?');" /> </ItemTemplate> </igtbl:TemplateDataField> </Columns> </igtbl:Band> <igtbl:Band Key="VICTIMS" AutoGenerateColumns="false" DataKeyFields="lngId,lngStudentId,lngFacultyStaffId"> <Columns> <igtbl:TemplateDataField Key="View" Width="20px" /> <igtbl:TemplateDataField Key="Edit" Width="20px" /> <igtbl:BoundDataField Key="STRNAME" DataFieldName="STRNAME" Width="90%"></igtbl:BoundDataField> <igtbl:BoundDataField Key="STRGRADE" DataFieldName="STRGRADE" Width="10%"></igtbl:BoundDataField> <igtbl:TemplateDataField Key="Delete" Width="20px"> <ItemTemplate> <asp:ImageButton ID="btnDelete" runat="server" CommandArgument="VICTIMS" OnCommand="btnDelete_Command" ImageUrl="~/Images/Icons/Delete16.gif" ToolTip="Delete" OnClientClick="return confirm('Are you sure you want to delete this record?');" /> </ItemTemplate> </igtbl:TemplateDataField> </Columns> <Bands> <igtbl:Band Key="VICTIMSCMMT" AutoGenerateColumns="false" DataKeyFields="lngId,lngStudentId,lngFacultyStaffId"> <Columns> <igtbl:BoundDataField Key="STRCOMMENT" DataFieldName="STRCOMMENT" Header-Text="Comment" Width="100%"></igtbl:BoundDataField> </Columns> <Behaviors> <igtbl:EditingCore BatchUpdating="true"> <Behaviors> <igtbl:CellEditing> <EditModeActions EnableOnActive="true" MouseClick="Single" /> <ColumnSettings> <igtbl:EditingColumnSetting ColumnKey="STRCOMMENT" ReadOnly="true" /> </ColumnSettings> </igtbl:CellEditing> </Behaviors> </igtbl:EditingCore> </Behaviors> </igtbl:Band> </Bands> <Behaviors> <igtbl:EditingCore BatchUpdating="true"> <Behaviors> <igtbl:CellEditing> <EditModeActions EnableOnActive="true" MouseClick="Single" /> <ColumnSettings> <igtbl:EditingColumnSetting ColumnKey="STRNAME" ReadOnly="true" /> <igtbl:EditingColumnSetting ColumnKey="STRGRADE" ReadOnly="true" /> </ColumnSettings> <CellEditingClientEvents EnteringEditMode="Grid_EnteringEditMode" /> </igtbl:CellEditing> </Behaviors> </igtbl:EditingCore> </Behaviors> </igtbl:Band> <igtbl:Band Key="WITNESSES" AutoGenerateColumns="false" DataKeyFields="lngId,lngStudentId,lngFacultyStaffId"> <Columns> <igtbl:TemplateDataField Key="View" Width="20px" /> <igtbl:TemplateDataField Key="Edit" Width="20px" /> <igtbl:BoundDataField Key="STRNAME" DataFieldName="STRNAME" Width="90%"></igtbl:BoundDataField> <igtbl:BoundDataField Key="STRGRADE" DataFieldName="STRGRADE" Width="10%"></igtbl:BoundDataField> <igtbl:TemplateDataField Key="Delete" Width="20px"> <ItemTemplate> <asp:ImageButton ID="btnDelete" runat="server" CommandArgument="WITNESSES" OnCommand="btnDelete_Command" ImageUrl="~/Images/Icons/Delete16.gif" ToolTip="Delete" OnClientClick="return confirm('Are you sure you want to delete this record?');" /> </ItemTemplate> </igtbl:TemplateDataField> </Columns> <Bands> <igtbl:Band Key="WITNESSESCMMT" AutoGenerateColumns="false" DataKeyFields="lngId,lngStudentId,lngFacultyStaffId"> <Columns> <igtbl:BoundDataField Key="STRCOMMENT" DataFieldName="STRCOMMENT" Header-Text="Comment" Width="100%"></igtbl:BoundDataField> </Columns> <Behaviors> <igtbl:EditingCore BatchUpdating="true"> <Behaviors> <igtbl:CellEditing> <EditModeActions EnableOnActive="true" MouseClick="Single" /> <ColumnSettings> <igtbl:EditingColumnSetting ColumnKey="STRCOMMENT" ReadOnly="true" /> </ColumnSettings> </igtbl:CellEditing> </Behaviors> </igtbl:EditingCore> </Behaviors> </igtbl:Band> </Bands> <Behaviors> <igtbl:EditingCore BatchUpdating="true"> <Behaviors> <igtbl:CellEditing> <EditModeActions EnableOnActive="true" MouseClick="Single" /> <ColumnSettings> <igtbl:EditingColumnSetting ColumnKey="STRNAME" ReadOnly="true" /> <igtbl:EditingColumnSetting ColumnKey="STRGRADE" ReadOnly="true" /> </ColumnSettings> <CellEditingClientEvents EnteringEditMode="Grid_EnteringEditMode" /> </igtbl:CellEditing> </Behaviors> </igtbl:EditingCore> </Behaviors> </igtbl:Band> </Bands> <Behaviors> <igtbl:Activation /> </Behaviors> </igtbl:WebHierarchicalDataGrid>
--------------------End-------------------------------------
On Code behind:
--------------------Begin-------------------------------------
Me.DEPA.Rows.Clear() Me.DEPA.DataSource = dsDataSet Me.DEPA.GridView.DataMember = "DisciplineEventParticipants" Me.DEPA.Bands.Item(0).DataMember = "DisciplineEventPrepetrators" Me.DEPA.Bands.Item(1).DataMember = "DisciplineEventVictimWitness" Me.DEPA.Bands.Item(2).DataMember = "DisciplineEventVictimWitness" Me.DEPA.Bands.Item(1).Bands.Item(0).DataMember = "DisciplineEventVictimWitness" Me.DEPA.Bands.Item(2).Bands.Item(0).DataMember = "DisciplineEventVictimWitness" Me.DEPA.DataBind()
-------------------End--------------------------------------
Additional Info:
Quick reply will be appreciated..!!
--
Greetings
Abhishek
Have you managed to find the solution for this?
I am getting the same error message when selecting page number on the WHDG pager, but it seems to happen only when I have some row summaries turned on.
Hello gregehr,
Thank you for your reply. Is it possible to share a working sample showing this behavior in order to allow me to examine the matter further ?
I am currently looking into this matter and will keep you posted of my progress and findings. Thank you for your patience.
I have created a sample based on your code but am so far unable to replicate the behavior. Attached is the sample for your consideration. Please feel free to modify it in order to demonstrate the issue in question.
Do not hesitate to contact me with any updates or questions.
Peter,
Your sample doesn't add any active summaries to the grid.
Could you try adding something like this to the InitializeBand function just before RefreshBehavios?
ColumnSummaryInfo csi = new ColumnSummaryInfo();
csi.ColumnKey = band.Columns["Sum"].Key;
csi.Summaries.Add(SummaryType.Sum);
band.Behaviors.SummaryRow.ColumnSummaries.Add(csi);
I have done a little more exploration on this and find that it is not the addition of summaries that caused the problem.
It was my first attempt to add a MaskEditorProvider to the column.
I will research the proper way to do this and post back if I have difficulties with it.
Thank you for the time you spent attempting to help.
Gerry
Hello Gerry,
Thank you for your reply. Glad that you were able to find the source of the issue !
Please do not hesitate to contact me if any questions arise.