Browse Source

Fix to multi-delete in onetomany grid

Kenric Nugteren 2 years ago
parent
commit
a5499e7e83
1 changed files with 3 additions and 2 deletions
  1. 3 2
      inabox.wpf/DynamicGrid/DynamicOneToManyGrid.cs

+ 3 - 2
inabox.wpf/DynamicGrid/DynamicOneToManyGrid.cs

@@ -237,9 +237,10 @@ namespace InABox.DynamicGrid
 
         protected override void DeleteItems(params CoreRow[] rows)
         {
-            foreach(var row in rows)
+            var items = rows.Select(LoadItem).ToList();
+            foreach(var item in items)
             {
-                Items.Remove(LoadItem(row));
+                Items.Remove(item);
             }
         }