RadGrid Delete Error

5 posts, 0 answers
  1. David
    David avatar
    8 posts
    Member since:
    Aug 2010

    Posted 27 Sep 2010 Link to this post

    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
  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 27 Sep 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    87 posts
    Member since:
    Jul 2010

    Posted 28 Sep 2010 Link to this post

    Thanks very much Pavlina.

    That did solve my problem. Very much appreciated!
  5. John
    John avatar
    43 posts
    Member since:
    Aug 2014

    Posted 07 Apr 2015 in reply to Pavlina Link to this post

    I'm getting the same issue; but, the link is no longer valid.  Suggestions?
  6. John
    John avatar
    43 posts
    Member since:
    Aug 2014

    Posted 07 Apr 2015 Link to this post

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

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

     

     

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017