Przeglądaj źródła

CodePopup editor blank value functionality improvement

Kenric Nugteren 1 miesiąc temu
rodzic
commit
704ce913c4

+ 11 - 3
inabox.wpf/DynamicGrid/Editors/CodePopupEditor/CodePopupEditorControl.cs

@@ -100,10 +100,18 @@ public class CodePopupEditorControl : DynamicEditorControl<Guid, CodePopupEditor
         if (Editor.Text.Equals(origvalue))
             return;
 
-        var id = _value;
-        LookupValue(CodeColumn, Editor.Text);
-        if (id == Guid.Empty)
+        if (string.IsNullOrEmpty(Editor.Text))
+        {
+            LookupValue(nameof(Entity.ID), Guid.Empty);
             CheckChanged();
+        }
+        else
+        {
+            var id = _value;
+            LookupValue(CodeColumn, Editor.Text);
+            if (id == Guid.Empty)
+                CheckChanged();
+        }
     }