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();
}