فهرست منبع

Fix to bug with sequencing

Kenric Nugteren 7 ماه پیش
والد
کامیت
b1cae8d484
2فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 2 2
      inabox.wpf/DynamicGrid/DynamicGrid.cs
  2. 1 0
      inabox.wpf/DynamicGrid/UIComponent/DynamicGridGridUIComponent.cs

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

@@ -2140,7 +2140,7 @@ public abstract class DynamicGrid<T> : DynamicGrid, IDynamicGridUIComponentParen
     {
     {
         if (!Options.ReorderRows || !IsSequenced) return;
         if (!Options.ReorderRows || !IsSequenced) return;
 
 
-        var items = rows.ToArray<T>();
+        var items = LoadItems(rows);
         if (isCopy)
         if (isCopy)
         {
         {
             if (!BeforeCopy(items))
             if (!BeforeCopy(items))
@@ -2155,7 +2155,7 @@ public abstract class DynamicGrid<T> : DynamicGrid, IDynamicGridUIComponentParen
 
 
         var postRows = Data.Rows.Where(r => !rows.Contains(r) && r.Get<ISequenceable, long>(x => x.Sequence) >= sequence);
         var postRows = Data.Rows.Where(r => !rows.Contains(r) && r.Get<ISequenceable, long>(x => x.Sequence) >= sequence);
 
 
-        var updates = items.Concat(postRows.ToObjects<T>()).ToArray();
+        var updates = items.Concatenate(LoadItems(postRows.ToArray()));
         foreach (var update in updates)
         foreach (var update in updates)
         {
         {
             ((ISequenceable)update).Sequence = sequence;
             ((ISequenceable)update).Sequence = sequence;

+ 1 - 0
inabox.wpf/DynamicGrid/UIComponent/DynamicGridGridUIComponent.cs

@@ -179,6 +179,7 @@ public class DynamicGridGridUIComponent<T> : IDynamicGridUIComponent<T>, IDynami
             return null;
             return null;
         });
         });
         DataGrid.RowDropIndicatorMode = DropIndicatorMode.Line;
         DataGrid.RowDropIndicatorMode = DropIndicatorMode.Line;
+        DataGrid.RowDragDropController ??= new GridRowDragDropController();
         
         
         DataGrid.CurrentCellBorderThickness = new Thickness(0);
         DataGrid.CurrentCellBorderThickness = new Thickness(0);
         DataGrid.AllowFiltering = false;
         DataGrid.AllowFiltering = false;