浏览代码

Re-added filtering for DynamicTextColumn

Kenric Nugteren 6 月之前
父节点
当前提交
b83f481458
共有 2 个文件被更改,包括 14 次插入3 次删除
  1. 1 1
      inabox.wpf/DynamicGrid/Columns/DynamicTextColumn.cs
  2. 13 2
      inabox.wpf/DynamicGrid/Grids/DynamicGrid.cs

+ 1 - 1
inabox.wpf/DynamicGrid/Columns/DynamicTextColumn.cs

@@ -18,7 +18,7 @@ public class DynamicTextColumn : DynamicActionColumn
         Alignment = Alignment.MiddleCenter;
         VerticalHeader = false;
     }
-        
+
     public DynamicTextColumn(GetTextDelegate text, ActionDelegate? action = null) : this()
     {
         Text = text;

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

@@ -562,9 +562,20 @@ public abstract class DynamicGrid<T> : DynamicGrid, IDynamicGridUIComponentParen
                 return new StandardDynamicGridColumnFilter(this, column);
             }
         }
-        else if(column is DynamicActionColumn ac && ac.GetFilter is not null)
+        else if(column is DynamicActionColumn ac)
         {
-            return ac.GetFilter();
+            if(ac.GetFilter is not null)
+            {
+                return ac.GetFilter();
+            }
+            else if(ac is DynamicTextColumn textColumn)
+            {
+                return new StandardDynamicGridColumnFilter(this, textColumn);
+            }
+            else
+            {
+                return null;
+            }
         }
         else
         {