Forráskód Böngészése

Fixed problem where the columns that get loaded from the DB can be empty because the columns have changed names or editor types, and this meant there was no way to actually reset the columns

Kenric Nugteren 1 hete
szülő
commit
e914892d83

+ 5 - 3
inabox.wpf/DynamicGrid/DynamicGridCustomColumnsComponent.cs

@@ -37,9 +37,6 @@ public class DynamicGridCustomColumnsComponent<T>
 
         var columns = user.Result.Any() ? user.Result : global.Result;
 
-        if (!columns.Any())
-            columns = Grid.GenerateColumns();
-
         columns.RemoveAll(x =>
         {
             if (x.ColumnName.IsNullOrWhiteSpace()) return true;
@@ -51,6 +48,11 @@ public class DynamicGridCustomColumnsComponent<T>
             return false;
         });
 
+        if (!columns.Any())
+        {
+            columns = Grid.GenerateColumns();
+        }
+
         return columns;
     }