Explorar el Código

Made PopupEditor use the LookupFactory.FormatLookup fucntion

Kenric Nugteren hace 7 meses
padre
commit
972c64a11c

+ 7 - 4
inabox.wpf/DynamicGrid/Editors/PopupEditor/PopupEditorControl.cs

@@ -162,10 +162,13 @@ public class PopupEditorControl : DynamicEditorControl<Guid, PopupEditor>
         var lookup = client.Query(filter, columns, sort);
         var display = new List<object?>();
         if (lookup.Rows.Any())
-            foreach (var col in lookup.Columns.Where(x => !x.ColumnName.Equals("ID")))
-                display.Add(lookup.Rows.First()[col.ColumnName]);
-
-        Editor.Text = string.Join(" / ", display.Where(x => x != null && !string.IsNullOrWhiteSpace(x.ToString())));
+        {
+            Editor.Text = LookupFactory.FormatLookup(Host.GetEditorType(), _type, lookup.Rows.First(), ColumnName);
+        }
+        else
+        {
+            Editor.Text = "";
+        }
     }
 
     public override void SetFocus()