Hi all,
I am using the following code in pageload of my usercontrol where infragistics is used.
In Page_Load()
DropDownProvider Statusddl = new DropDownProvider(); Statusddl.ID = "Statusddl_" + editcolumns.IndexOf(assignedToColumnSetting).ToString();Statusddl.EditorControl.Items.Add(new Infragistics.Web.UI.ListControls.DropDownItem("")); this.UltraWebGrid.EditorProviders.Add(Statusddl); switch (assignedToColumnSetting.ColumnKey) { case "Logic Status": foreach (string dv in BLDomain.GetDomainValueListByDomainName("Logic Status", this.CurrentLibraryId)) Statusddl.EditorControl.Items.Add(new Infragistics.Web.UI.ListControls.DropDownItem(dv)); break; case "Logic1 Status": foreach (string dv in BLDomain.GetDomainValueListByDomainName("Logic1 Check Status", this.CurrentLibraryId)) Statusddl.EditorControl.Items.Add(new Infragistics.Web.UI.ListControls.DropDownItem(dv)); break; case "Logic2 Status": foreach (string dv in BLDomain.GetDomainValueListByDomainName("Logic2 Check Status", this.CurrentLibraryId)) Statusddl.EditorControl.Items.Add(new Infragistics.Web.UI.ListControls.DropDownItem(dv)); break; case "PhySym Status": foreach (string dv in BLDomain.GetDomainValueListByDomainName("Physical Status", this.CurrentLibraryId)) Statusddl.EditorControl.Items.Add(new Infragistics.Web.UI.ListControls.DropDownItem(dv)); break; case "iPN Status": foreach (string dv in BLDomain.GetDomainValueListByDomainName("IPN Status", this.CurrentLibraryId)) Statusddl.EditorControl.Items.Add(new Infragistics.Web.UI.ListControls.DropDownItem(dv)); break; default: Statusddl = ddl; break;
} assignedToColumnSetting.EditorID = Statusddl.ID;
Now in UI of my user control the definition of webdatagrid is as follows
EnableRelativeLayout="false" HeaderCaptionCssClass="GridHeaderCaption" OnInit="UltraWebGrid_Init" onrowupdated="UltraWebGrid_RowUpdated" OnRowUpdating="UltraWebGrid_RowUpdating" OnColumnMoved="UltraWebGrid_ColumnMoved" EnableAjax="true" EnableAjaxViewState="true" EnableDataViewState="True" OnColumnResized="UltraWebGrid_ColumnResized" OnColumnSorted="UltraWebGrid_ColumnSorted"> <ig:Sorting >
The RowUpdating method
protected void UltraWebGrid_RowUpdating(object sender, RowUpdatingEventArgs e) { string requestId = e.Values[MyQueueConst.REQUEST_ID].ToString(); //Get the Column name being Edited string colname = string.Empty; string assignedTo = string.Empty; foreach (DictionaryEntry entry in e.OldValues) { if (e.Values.ContainsKey(entry.Key) && e.Values[entry.Key].Equals(entry.Value)) { continue; } else colname = entry.Key.ToString(); } assignedTo = e.Values[colname].ToString(); int iRequestId = Int32.Parse(requestId);
BLRequest.UpdateRequestAssignmentForASPNET(iRequestId, colname, assignedTo, this.CurrentLibraryId, this.CurrentUser);
//Update the datasoure DataRow currentRow = this.HomeGridDataSource.Select(MyQueueConst.REQUEST_ID + "=" + requestId).FirstOrDefault(); currentRow[colname] = assignedTo;
this.UltraWebGrid.DataSource = this.HomeGridDataSource; this.UltraWebGrid.DataBind();
}
Now, when I try to edit the dropdown from the Infragistics Grid UI I get the following Error, especially since I am adding the Empty entry in my dropdown provider
Async request failed
[ArgumentOutOfRangeException]: Insertion index was out of range. Must be non-negative and less than or equal to size.
Parameter name: index
at System.Collections.ArrayList.Insert(Int32 index, Object value)
at Infragistics.Web.UI.Framework.ObjectCollection.InternalInsert(Int32 index, ICollectionObject collectionObject)
at Infragistics.Web.UI.Framework.ViewStateJournal.LoadJournalState(ObjectCollection objectCollection, String actions)
at Infragistics.Web.UI.Framework.ObjectCollection.LoadViewState(Object savedState)
at Infragistics.Web.UI.Framework.ObjectCollection.System.Web.UI.IStateManager.LoadViewState(Object savedState)
at Infragistics.Web.UI.ListControls.ListControl.LoadViewState(Object savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown.
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\Users\pavankka\AppData\Local\Temp\Temporary ASP.NET Files\root\b51783cb\a3e13343\App_Web_0gcorezp.1.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
A Screenshot is here
Any Idea of why is this happening? I am using Infragistics version 12.2
Hello Prabha,
Thank you for contacting Infragistics!
It seems like from the code this is something you setup for multiple columns. Do they all throw the error? Do you have a sample you can provide me that demonstrates the issue so I can dug further into the code and see how it is running?