Kaynağa Gözat

wpf: Fix to DynamicGrid sequencing when moving rows

Kenric Nugteren 2 hafta önce
ebeveyn
işleme
3355061c0f
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      inabox.wpf/DynamicGrid/Grids/DynamicGrid.cs

+ 3 - 1
inabox.wpf/DynamicGrid/Grids/DynamicGrid.cs

@@ -1043,7 +1043,9 @@ public abstract class DynamicGrid<T> : BaseDynamicGrid, IDynamicGridUIComponentP
 
         var postRows = Data.Rows.Where(r => !rows.Contains(r) && r.Get<ISequenceable, long>(x => x.Sequence) >= sequence);
 
-        var updates = items.Concatenate(LoadItems(postRows.ToArray()));
+        var postItems = LoadItems(postRows.ToArray());
+        postItems.SortBy(x => (x as ISequenceable)?.Sequence ?? 0);
+        var updates = items.Concatenate(postItems);
         foreach (var update in updates)
         {
             ((ISequenceable)update).Sequence = sequence;