Просмотр исходного кода

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 2 недель назад
Родитель
Сommit
e914892d83
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      inabox.wpf/DynamicGrid/DynamicGridCustomColumnsComponent.cs

+ 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;
     }