|
@@ -17,8 +17,9 @@ namespace InABox.DynamicGrid
|
|
|
private readonly string[] _othercolumns = Array.Empty<string>();
|
|
|
|
|
|
private readonly Type _type;
|
|
|
+ private readonly Type? _gridType;
|
|
|
|
|
|
- public PopupList(Type type, Guid id, string[] OtherColumns, Dictionary<string, string>? Filters = null)
|
|
|
+ public PopupList(Type type, Guid id, string[] OtherColumns, Dictionary<string, string>? Filters = null, Type? gridType = null)
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
|
|
@@ -27,6 +28,7 @@ namespace InABox.DynamicGrid
|
|
|
_filters = Filters;
|
|
|
_othercolumns = OtherColumns;
|
|
|
_type = type;
|
|
|
+ _gridType = gridType;
|
|
|
|
|
|
ID = id;
|
|
|
|
|
@@ -54,7 +56,7 @@ namespace InABox.DynamicGrid
|
|
|
private void PopupList_SourceInitialized(object? sender, EventArgs e)
|
|
|
{
|
|
|
//_grid = DynamicGridUtils.CreateDynamicGrid(typeof(DynamicDataGrid<>), _type);
|
|
|
- _grid = (Activator.CreateInstance(typeof(DynamicDataGrid<>).MakeGenericType(_type)) as IDynamicGrid)!;
|
|
|
+ _grid = (Activator.CreateInstance(_gridType ?? typeof(DynamicDataGrid<>).MakeGenericType(_type)) as IDynamicGrid)!;
|
|
|
_grid.Margin = new Thickness(5, 5, 5, 0);
|
|
|
((DependencyObject)_grid).SetValue(Grid.ColumnProperty, 0);
|
|
|
((DependencyObject)_grid).SetValue(Grid.ColumnSpanProperty, 3);
|
|
@@ -78,7 +80,10 @@ namespace InABox.DynamicGrid
|
|
|
).EndUpdate();
|
|
|
});
|
|
|
|
|
|
- CoreUtils.SetPropertyValue(_grid, "ColumnsTag", "Popup");
|
|
|
+ if(_grid is IDynamicDataGrid dataGrid)
|
|
|
+ {
|
|
|
+ dataGrid.ColumnsTag ??= "Popup";
|
|
|
+ }
|
|
|
|
|
|
_grid.OnDefineFilter += t => OnDefineFilter?.Invoke(t);
|
|
|
|