This is a migrated thread and some comments may be shown as answers.

RadGrid Delete Error

4 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 27 Sep 2010, 09:51 AM
Hi,

I'm working on a project which uses the RadGrid from the classic controls.

Basically, the scenario is this. When the user clicks on an edit button for a row of the RadGrid, the panel which contains the RadGird is made invisible, and another panel with an assortment of textboxes and comboboxes is made visible with details of that grid row item populating thos controls. There is also a delete button on that panel, which delete that item in the database when clicked.

The problem arises when the grid is reloaded after that delete. Following the delete button being clicked, the grid's panel is made visible again and the grid is rebound. If I then click on one of the edit buttons for a row in the grid, the following error is thrown:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex]
   Telerik.WebControls.GridItemCollection.get_Item(String hierarchicalIndex) +103
   Telerik.WebControls.GridDataItemCollection.get_Item(String hierarchicalIndex) +37
   Telerik.WebControls.RadGrid.get_EditItems() +215
   Telerik.WebControls.RadGrid.SaveEditIndexState(String newValue) +95
   Telerik.WebControls.GridItem.set_Edit(Boolean value) +82
   Telerik.WebControls.GridCommandEventArgs.ExecuteCommand(Object source) +236
   Telerik.WebControls.RadGrid.OnBubbleEvent(Object source, EventArgs e) +191
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.WebControls.GridItem.OnBubbleEvent(Object source, EventArgs e) +165
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +111
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +176
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
 
Any help would be appreciated. Previous searches of this forum show others have had the same problem and not resolved it.

Cheers

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 27 Sep 2010, 12:03 PM
Hi David,

Please refer to the following forum thread which elaborates on this matter and see if it helps to avoid this error:
http://www.telerik.com/community/forums/aspnet/grid/38401-specified-argument-was-out-of-the-range-of-valid-values-parameter-name-itemhierarchicalindex.aspx

Regards,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 28 Sep 2010, 06:51 AM
Thanks very much Pavlina.

That did solve my problem. Very much appreciated!
0
John
Top achievements
Rank 1
answered on 07 Apr 2015, 09:20 PM
I'm getting the same issue; but, the link is no longer valid.  Suggestions?
0
John
Top achievements
Rank 1
answered on 07 Apr 2015, 09:53 PM

*** Solved ***  I moved the following from the main RadGrid declaration its MasterTableView declaration ...

                    AllowAutomaticUpdates="true"
                    AllowAutomaticInserts="true"
                    AllowAutomaticDeletes="true"

 

 

Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
David
Top achievements
Rank 1
John
Top achievements
Rank 1
Share this question
or