Hi,
I have an editable grid within a user control being rendered from another user control which in turn are rendered from master page.
While the initial loading and display of the grid works fine, but when there is a post back of the page(Eg when a button is clicked) it throws the below error:
Error is thrown before the Server side event of click Button is triggered.
The ColumnSorted event is also not hit before the error is thrown.
DataBind happens in the page_load event of the user control where we dynamically load the data into the WebDataGrid.
How to resolve this?
Index was outside the bounds of the array.
Stack Trace:
at Infragistics.Web.UI.GridControls.Sorting.LoadClientCollections(Object[] data) at Infragistics.Web.UI.Framework.ObjectBase.LoadClientState(Object[] oData) at Infragistics.Web.UI.Framework.ObjectBase.Infragistics.Web.UI.IClientState.LoadClientState(Object[] oData) at Infragistics.Web.UI.GridControls.GridBot.LoadClientCollections(Object[] collections) at Infragistics.Web.UI.Framework.RunBot.LoadClientData() at Infragistics.Web.UI.GridControls.WebDataGrid.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at System.Web.UI.HtmlControls.HtmlTable.HtmlTableRowControlCollection.Add(Control child) at System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) at System.Web.UI.HtmlControls.HtmlTable.HtmlTableRowControlCollection.AddAt(Int32 index, Control child) at System.Web.UI.HtmlControls.HtmlTableRowCollection.Add(HtmlTableRow row) at ASPNetPortal.DesktopDefault.Page_Init(Object sender, EventArgs e) in Default.aspx.vb:line 165 at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.Page.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Target Site:
{Void LoadClientCollections(System.Object[])}
.Ascx->
<asp:panel id="pnlModuleContent" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" runat="server" cssclass="WideModule"> <asp:PlaceHolder id="plhFilterContents" Runat="server"></asp:PlaceHolder> <asp:ScriptManagerProxy runat="server"></asp:ScriptManagerProxy> <ig:WebExcelExporter ID="eExporter" runat="server"></ig:WebExcelExporter> <ig:WebDataGrid ID="grdDataTable" runat="server" AutoGenerateColumns="true" width="100%" ClientIDMode="Static" EnableDataViewState ="true" EnableViewState ="true" HeaderCaptionCssClass="WebDataGridColumnHeader" ItemCssClass = "WebDataGridRow" AltItemCssClass = "WebDataGridAlternating" OnColumnSorted="grdDataTable_SortColumn" OnPageIndexChanged="grdDataTable_PageIndexChanged" OnInitializeRow="grdDataTable_InitializeRow" EnableAjax ="true" OnRowAdding="grdDataTable_RowAdding" OnRowUpdating="grdDataTable_RowUpdating"> <Behaviors> <ig:Selection CellClickAction="Row" CellSelectType="Single" RowSelectType="Single" SelectedRowSelectorCssClass="DataGridSelectedRow" > <SelectionClientEvents RowSelectionChanged="RowSelection_Changed" /> </ig:Selection> <ig:Paging PagerAppearance="Bottom" PageSize="100" Enabled="true" /> <ig:Sorting SortingMode="Single" Enabled="true" /> <ig:ColumnResizing Enabled="false" /> <ig:EditingCore Enabled="false" EnableInheritance="false" AutoCRUD="false" BatchUpdating="true"> <EditingClientEvents CellValueChanged="EditingEvents_CellValueChanged" RowAdding="EditingEvents_RowAdding" /> <Behaviors> <ig:RowAdding Enabled="false" EnableInheritance="false" Alignment="Bottom"> <EditModeActions EnableOnActive="true" MouseClick="Single" /> </ig:RowAdding> <ig:RowEditing Enabled="false" EnableInheritance="false"> <EditModeActions EnableOnActive="true" MouseClick="Single" /> <RowEditingClientEvents EnteringEditMode="RowEditing_EnteringEditMode" ExitedEditMode="RowEditing_ExitedEditMode" /> <ColumnSettings> <ig:EditingColumnSetting ReadOnly="true" /> </ColumnSettings> </ig:RowEditing> </Behaviors> </ig:EditingCore> <%--<ig:EditingCore Enabled="false"> </ig:EditingCore>--%> <ig:Activation></ig:Activation> </Behaviors> <ClientEvents Initialize="Initialize" /> </ig:WebDataGrid> <asp:datagrid id="dgHidden" visible="False" runat="server" autogeneratecolumns="True" headerstyle-cssclass="ListHead"></asp:datagrid> <INPUT id="hdnEditRow" type="hidden" value="-1" name="hdnEditRow" runat="server" /> <asp:label id="lblApplicationError" visible="True" runat="server" cssclass="ErrorMessage" enableviewstate="false"></asp:label> <DIV align="left" style="vertical-align:middle"> <asp:label id="lblNoData" visible="False" runat="server" cssclass="normal">No data available.</asp:label> </DIV> </asp:panel>
Server Side (Related to Sorting):
Protected Sub grdDataTable_SortColumn(sender As Object, e As SortingEventArgs) Handles grdDataTable.ColumnSorted Dim i As Integer Dim gridRefreshed As Boolean = False
RaiseEvent GridNeedsDataRefresh() gridRefreshed = True
' 12/17/2004 BWM: Check if the grid was already refresh above, otherwise the it will be refreshed twice. If grdDataTable.Behaviors.Paging.Enabled And Not gridRefreshed Then RaiseEvent PagedGridNeedsDataRefresh() End If End Sub
Thanks,
Aravind
Hello Aravind,
Thank you for the code you have sent.
I followed the steps you suggested and was unable to reproduce the behavior you're describing. As there are possibly an additional settings which might cause this error, it will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Having this sample will help to further investigate this issue.
Nick,
Is there a way we can have a conference session with you and share our screen to show the issue we are facing? It is difficult to come up with an isolated sample application that demonstrates the behavior since we get the data from database, dynamically bind the data and there are other dependencies. The wrapper(Functionality of the web data grid) is inside a user control, which in turn is used by other user controls which in turn is used by a master page(Recursive way of loading user controls). You can share your contact number or availability time in EST with the case#: CAS-194960-T5P2B0 .
Also you highlighted additional settings that can cause this error? What are they?
The described sample is needed so it can be debugged and tested and this can be achieved only with a sample, in this scenario an online session will not provide a sufficient information. I have attached a small isolated project. You can modify it so the issue you are describing is reproduced and send it back. This will help us to investigate this further.
I will also suggest testing your application with the 17.2 initial release version. Your feedback if the issue is still reproducible will be appreciated.
Additionally if there are several issues the best approach is to separate them in different forum threads/ cases (using this approach you can create a new one). This way every question will be investigated separately. As I understand case CAS-194960-T5P2B0 you refer to is already submitted for another issue.7484.Sample.zip
I have opened up a new case for this "CAS-195072-S7B2F0"
Please note that the code base i have attached with this case is the best trimmed down version i can go into and i can mimic this issue in this code base. Please follow the instructions in the case on mimicking the issue.
Thank you for sending the sample. I will update you with further information through the case.
As discussed we will use the older version of Infragistics Webdatagrid (1007) that doesn't have this bug untill you let us know when the bug fix is done in future.
Thank you for your feedback.
You will be notified through the case for any updates on this issue.
Let me know if you have further questions.