Hi,
I am creating a Grid dynamically and i am using grid.columns.Clear() to clear the columns before adding the new columns to the grid.But that causes the following error,and i have tried to set GridTableView.EnableColumnsViewState to False but that does not work.
Please give the solution for this problem.
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.Collections.ArrayList.get_Item(Int32 index) +2776221
Telerik.WebControls.GridColumnCollection.x107df2cdc54f1163() +635
Telerik.WebControls.GridTableView.x2f42edb67de223fa() +2342
Telerik.WebControls.RadGrid.xecc39c6829764c81(ArrayList x968349690f5f2dca, GridTableView x97cb49e21273638b) +73
Telerik.WebControls.RadGrid.SaveViewState() +439
System.Web.UI.Control.SaveViewStateRecursive() +137
System.Web.UI.Control.SaveViewStateRecursive() +254
System.Web.UI.Control.SaveViewStateRecursive() +254
System.Web.UI.Control.SaveViewStateRecursive() +254
System.Web.UI.Control.SaveViewStateRecursive() +254
System.Web.UI.Page.SaveAllState() +602
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5016
I am creating a Grid dynamically and i am using grid.columns.Clear() to clear the columns before adding the new columns to the grid.But that causes the following error,and i have tried to set GridTableView.EnableColumnsViewState to False but that does not work.
Please give the solution for this problem.
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.Collections.ArrayList.get_Item(Int32 index) +2776221
Telerik.WebControls.GridColumnCollection.x107df2cdc54f1163() +635
Telerik.WebControls.GridTableView.x2f42edb67de223fa() +2342
Telerik.WebControls.RadGrid.xecc39c6829764c81(ArrayList x968349690f5f2dca, GridTableView x97cb49e21273638b) +73
Telerik.WebControls.RadGrid.SaveViewState() +439
System.Web.UI.Control.SaveViewStateRecursive() +137
System.Web.UI.Control.SaveViewStateRecursive() +254
System.Web.UI.Control.SaveViewStateRecursive() +254
System.Web.UI.Control.SaveViewStateRecursive() +254
System.Web.UI.Control.SaveViewStateRecursive() +254
System.Web.UI.Page.SaveAllState() +602
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5016