Browse Source

Commented out DataGridItems.AcceptChanges(), which was causing filter refresh bugs. See PRS Digital Task #784.

Kenric Nugteren 1 năm trước cách đây
mục cha
commit
2d6f12b718

+ 6 - 1
inabox.wpf/DynamicGrid/DynamicGrid.cs

@@ -1102,7 +1102,12 @@ namespace InABox.DynamicGrid
                 DoChanged();
             bChanged = false;
             _editingObject = null;
-            DataGridItems?.AcceptChanges();
+
+            // Commented out on 19/02/2024 by Kenric. I don't see this being necessary, though I could be wrong. Nevertheless, it was causing a bug when
+            // editing the filter row. It seems that this causes Syncfusion to commit the filter predicates internally, which means that after leaving a 
+            // filter row cell, the filter remained even once it was cleared, meaning a refresh was necessary to get the data back.
+            // I've tested on Bills to see if editing works with this empty, and it seems so.
+            //DataGridItems?.AcceptChanges();
         }
 
         private void UpdateRow(CoreRow row, DataRow? dataRow, Dictionary<string, object?> changes)

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

@@ -49,14 +49,15 @@ namespace InABox.DynamicGrid
 
             property = CoreUtils.GetOneToManyProperty(typeof(TMany), typeof(TOne));
 
+            AddHiddenColumn(property.Name);
+            foreach (var col in LookupFactory.RequiredColumns<TMany>())
+                HiddenColumns.Add(col);
+
             ColumnsComponent = new DynamicGridCustomColumnsComponent<TMany>(this, GetTag());
         }
 
         protected override void Init()
         {
-            HiddenColumns.Add(property.Name);
-            foreach (var col in LookupFactory.RequiredColumns<TMany>())
-                HiddenColumns.Add(col);
         }
 
         protected override void DoReconfigure(FluentList<DynamicGridOption> options)