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

DeleteAll in Hierarchy grid

1 Answer 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Raja Mohammed
Top achievements
Rank 1
Raja Mohammed asked on 14 May 2010, 09:37 AM
hi,

 can u Please me for DeleteAll in Hierarchical Grid when its in Linq based Automatic operation ( add,edit,delete ) ..

this is the error  I face..

Could not find a row that matches the given keys in the original values stored in ViewState.  Ensure that the 'keys' dictionary contains unique key values that correspond to a row returned from the previous Select operation.


below is my code for your Reference ..

  <script type="text/javascript">
         function RowContextMenu(sender, eventArgs) {
             var menu = $find("<%=RadMenu1.ClientID %>");
             menu.show(eventArgs.get_domEvent());

             document.getElementById("radGridClickedRowIndex").value = eventArgs.get_itemIndexHierarchical();
             var ownerTable = eventArgs.get_tableView();

             document.getElementById("radGridClickedTableId").value = ownerTable._data.UniqueID;
         }
                </script>     


  ------------------------------------------------------------------------------------------------------------------------

   int radGridClickedRowIndex;
        string UId;

        string[] indices = Request.Form["radGridClickedRowIndex"].Split('_');
        radGridClickedRowIndex = Convert.ToInt32(indices[indices.Length - 1]);
        UId = Request.Form["radGridClickedTableId"]; 


if (Convert.ToInt32(RadGrid2.SelectedItems.Count) > 1)
                {
                     
                    tableView = this.Page.FindControl(UId) as GridTableView;

                    foreach (GridDataItem item in tableView.GetSelectedItems())
                    {
                    (tableView as GridTableView as GridTableView).PerformDelete(item,true);

                    }

                    RadGrid2.MasterTableView.Rebind();

                }

1 Answer, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 14 May 2010, 12:57 PM
Hello Raja,

I suggest that you review the following forum thread which discuss on a similar issue:
http://www.telerik.com/community/forums/aspnet-ajax/grid/deleting-from-nested-gridtableviews.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.
Tags
Grid
Asked by
Raja Mohammed
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or