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
145
Index must be within the bounds of the List. Parameter name: index error on webdatagrid databind
posted

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

Parents Reply Children
No Data