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

Nested grids and InsertNewRow issue

0 Answers 36 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
vk
Top achievements
Rank 1
vk asked on 16 May 2012, 09:56 AM
Hi,

I have a parent grid and a child one declared in the HierarchyChildTemplate. Both grids have ShowInsertRow set to true. If I click on the insert row panel in the inner grid and then click on the insert row panel in the parent grid, both rows go to an endless refreshing process and start flickering showing validation error signs...

Update: here is how I workarounded the issue:

void GridView_AddingNewDataItem(object sender, GridViewAddingNewEventArgs e)
{
   var grid = e.OwnerGridViewItemsControl;
   if (grid.Name == "parentGridView")
   {
      var childGrid = grid.ChildrenOfType<RadGridView>().Where(g => g.Name == "childGridView").SingleOrDefault();
      if (childGrid != null && childGrid.RowInEditMode is GridViewNewRow) childGrid.CancelEdit();
   }
   else if (parentGridView.RowInEditMode is GridViewNewRow) parentGridView.CancelEdit();
}

Tags
GridView
Asked by
vk
Top achievements
Rank 1
Share this question
or