Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
Index was outside the bounds of the array.
posted

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&nbsp;Staff" CssClass="HyperLink_Text" Width="10%"></asp:LinkButton>
                        </ItemTemplate>
                    </igtbl:TemplateDataField>
                    <igtbl:TemplateDataField Key="ADDVSTR">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkAddVisitor" runat="server" Text="Add&nbsp;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:

  • Using VS2013
  • Do not want to ajaxify page.
  • Created three bands static on same level.

Quick reply will be appreciated..!!

--

Greetings

Abhishek

Parents Reply Children
No Data