Browse Source

Fixed FilterConstant on filter editor

Kenric Nugteren 1 year ago
parent
commit
b52a101604

+ 2 - 2
inabox.wpf/DynamicGrid/Editors/FilterEditor/FilterNode.cs

@@ -232,8 +232,8 @@ public class FilterNode<T> : BaseFilterNode
     {
         var result = new ConstantNode();
 
-        Dictionary<String, FilterConstant?> values = new Dictionary<string, FilterConstant?>();
-        if (!String.IsNullOrWhiteSpace(propertyName))
+        var values = new Dictionary<string, FilterConstant?>();
+        if (!string.IsNullOrWhiteSpace(propertyName))
         {
             var property = CoreUtils.GetProperty(typeof(T), propertyName);
             var constants = FilterConstants.Constants(property.PropertyType, op);

+ 1 - 1
inabox.wpf/DynamicGrid/Editors/FilterEditor/Nodes/ConstantNode.cs

@@ -29,6 +29,6 @@ public class ConstantNode : ComboBox
     
     public FilterConstant? SelectedConstant {
         get => (SelectedItem != null) ? ((KeyValuePair<String,FilterConstant?>)SelectedItem).Value : null;
-        set => SelectedItem = Items.Contains(value) ? value : "";
+        set => SelectedValue = value;
     }
 }