Hi,
I am binding a webdatagrid with a dataset with several columns.
When i call the grid.databind for the firmst time to bind the dataset to the grid i get the below error
Index must be within the bounds of the List. Parameter name: index.
but the data will be bound and show on the grid.
Subsequent databinds do not give error.
Below is the stack trace of the error during databind
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.Collections.Generic.List`1.Insert(Int32 index, T item) at Infragistics.Web.UI.GridControls.VisibleItemsEnumerator.AdjustVisibleIndices(IVisibleItem item, Int32 newIndex) at Infragistics.Web.UI.GridControls.ControlDataField.set_VisibleIndex(Int32 value) at Infragistics.Web.UI.GridControls.GridField.set_VisibleIndex(Int32 value) at Infragistics.Web.UI.GridControls.WebDataGrid.CopyFields() at Infragistics.Web.UI.GridControls.WebDataGrid.FillFields() at Infragistics.Web.UI.GridControls.WebDataGrid.DataBind()
Can someone please explain why this might be happening?
Thanks
Niranjan
Hello Niranjan,
Thank you for contacting Infragistics!
I have done some looking into this matter and I have been unable to reproduce this behavior. I have some follow up questions concerning this matter:
What version and service release are you using? What browsers are you using? What properties and behaviors are you using for the WebDataGrid? How are you binding your data?
Looking forward to hearing from you.
Hi Mike,
I am using Infragistics ASP.net 2014 Version 14.1.2283.
The error occurs on databind even before the data is shown on the browser.
I am using dataset as datasource to the grid.
The below code is where i am getting the exception
grid.DataSource = ds.Tables[0];
grid.DataBind(); --Error here on databind.