|
@@ -1735,6 +1735,8 @@ namespace InABox.DynamicGrid
|
|
newcol = new DynamicGridDoubleColumn<T>(column);
|
|
newcol = new DynamicGridDoubleColumn<T>(column);
|
|
else if (prop.Editor is DateTimeEditor)
|
|
else if (prop.Editor is DateTimeEditor)
|
|
newcol = new DynamicGridDateTimeColumn<T>(column);
|
|
newcol = new DynamicGridDateTimeColumn<T>(column);
|
|
|
|
+ else if (prop.Editor is DateEditor)
|
|
|
|
+ newcol = new DynamicGridDateColumn<T>(column);
|
|
else if (prop.Editor is TimeOfDayEditor)
|
|
else if (prop.Editor is TimeOfDayEditor)
|
|
newcol = new DynamicGridTimeOfDayColumn<T>(column);
|
|
newcol = new DynamicGridTimeOfDayColumn<T>(column);
|
|
else if (prop.Editor is TimestampEditor)
|
|
else if (prop.Editor is TimestampEditor)
|
|
@@ -2501,8 +2503,7 @@ namespace InABox.DynamicGrid
|
|
|
|
|
|
if (IsDirectEditMode() && !OpenEditorOnDirectEdit)
|
|
if (IsDirectEditMode() && !OpenEditorOnDirectEdit)
|
|
{
|
|
{
|
|
- if (!CanCreateItems())
|
|
|
|
- return;
|
|
|
|
|
|
+
|
|
|
|
|
|
var item = CreateItem();
|
|
var item = CreateItem();
|
|
SaveItem(item);
|
|
SaveItem(item);
|
|
@@ -2530,7 +2531,8 @@ namespace InABox.DynamicGrid
|
|
|
|
|
|
private void Add_Click(object sender, RoutedEventArgs e)
|
|
private void Add_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|
|
- DoAdd();
|
|
|
|
|
|
+ if (CanCreateItems())
|
|
|
|
+ DoAdd();
|
|
}
|
|
}
|
|
|
|
|
|
public virtual DynamicEditorPages LoadEditorPages(T item)
|
|
public virtual DynamicEditorPages LoadEditorPages(T item)
|
|
@@ -2592,7 +2594,7 @@ namespace InABox.DynamicGrid
|
|
return result;
|
|
return result;
|
|
};
|
|
};
|
|
|
|
|
|
- editor.OnFormCustomiseEditor += (o, i, c, e) => OnCustomiseEditor?.Invoke(o, (T[])i, c, e);
|
|
|
|
|
|
+ editor.OnFormCustomiseEditor += DoCustomiseEditor;
|
|
|
|
|
|
editor.OnDefineFilter = (type) => { return DefineFilter(type, items); };
|
|
editor.OnDefineFilter = (type) => { return DefineFilter(type, items); };
|
|
|
|
|
|
@@ -2639,6 +2641,16 @@ namespace InABox.DynamicGrid
|
|
AfterLoad(editor, items);
|
|
AfterLoad(editor, items);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void DoCustomiseEditor(IDynamicEditorForm sender, object[] items, DynamicGridColumn column, BaseEditor editor)
|
|
|
|
+ {
|
|
|
|
+ CustomiseEditor((T[])items, column, editor);
|
|
|
|
+ OnCustomiseEditor?.Invoke(sender, (T[])items, column, editor);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected virtual void CustomiseEditor(T[] items, DynamicGridColumn column, BaseEditor editor)
|
|
|
|
+ {
|
|
|
|
+ }
|
|
|
|
+
|
|
protected virtual void DoAfterSave(IDynamicEditorForm editor, T[] items)
|
|
protected virtual void DoAfterSave(IDynamicEditorForm editor, T[] items)
|
|
{
|
|
{
|
|
OnAfterSave?.Invoke(editor, items);
|
|
OnAfterSave?.Invoke(editor, items);
|