Browse Source

Little tweaks.

Kenric Nugteren 6 months ago
parent
commit
e14dea7d9c

+ 2 - 3
inabox.wpf/DynamicGrid/UIComponent/DynamicGridGridUIComponent.cs

@@ -1232,7 +1232,7 @@ public class DynamicGridGridUIComponent : IDynamicGridUIComponent, IDynamicGridG
 
     private void LoadDataColumn(DynamicGridColumn column)
     {
-        column.Editor = Parent.CustomiseEditor(column,column.Editor);
+        column.Editor = Parent.CustomiseEditor(column, column.Editor);
         if (this.CreateEditorColumn(column, out var newcol))
         {
             if (!newcol.VariableHeight)
@@ -1258,8 +1258,7 @@ public class DynamicGridGridUIComponent : IDynamicGridUIComponent, IDynamicGridG
             var cellstyle = GetCellStyle(column);
             if (Parent.IsDirectEditMode())
             {
-                var editor = Parent.CustomiseEditor(column, column.Editor);
-                if (editor is null || !newcol.Editable || !editor.Editable.IsDirectEditable())
+                if (column.Editor is null || !newcol.Editable || !column.Editor.Editable.IsDirectEditable())
                 {
                     cellstyle.Setters.Add(new Setter(Control.BackgroundProperty,
                         new Binding()

+ 2 - 2
inabox.wpf/DynamicGrid/UIComponent/DynamicGridTreeUIComponent.cs

@@ -1258,6 +1258,7 @@ public class DynamicGridTreeUIComponent<T, TKey> : IDynamicGridUIComponent<T>, I
 
     private void LoadDataColumn(DynamicGridColumn column)
     {
+        column.Editor = Parent.CustomiseEditor(column, column.Editor);
         if(this.CreateEditorColumn<T>(column, out var newcol))
         {
             if(newcol is IDynamicGridEditorColumn<T> typed)
@@ -1282,8 +1283,7 @@ public class DynamicGridTreeUIComponent<T, TKey> : IDynamicGridUIComponent<T>, I
             var cellstyle = new Style();
             if (Parent.IsDirectEditMode())
             {
-                var editor = Parent.CustomiseEditor(column, column.Editor);
-                if (editor is null || !newcol.Editable || !editor.Editable.IsDirectEditable())
+                if (column.Editor is null || !newcol.Editable || !column.Editor.Editable.IsDirectEditable())
                 {
                     cellstyle.Setters.Add(new Setter(Control.BackgroundProperty,
                         new SolidColorBrush(Colors.WhiteSmoke)));