|
@@ -313,7 +313,22 @@ public class JobRequisitionReviewGrid : DynamicDataGrid<JobRequisitionItem>
|
|
|
if (row is null) return;
|
|
|
|
|
|
var requiID = row.Get<StockMovement, Guid>(x => x.ID);
|
|
|
- var grid = (DynamicGridUtils.CreateDynamicGrid(typeof(DynamicDataGrid<>), typeof(StockMovement)) as DynamicDataGrid<StockMovement>)!;
|
|
|
+
|
|
|
+ DynamicDataGrid<StockMovement> grid;
|
|
|
+ if (DynamicGridUtils.TryFindDynamicGrid(typeof(DynamicDataGrid<>), typeof(StockMovement), out var gridType))
|
|
|
+ {
|
|
|
+ grid = (Activator.CreateInstance(gridType) as DynamicDataGrid<StockMovement>)!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ grid = new DynamicDataGrid<StockMovement>();
|
|
|
+ grid.OnReconfigure += (options) =>
|
|
|
+ {
|
|
|
+ options.Add(DynamicGridOption.SelectColumns);
|
|
|
+ };
|
|
|
+ grid.Reconfigure();
|
|
|
+ }
|
|
|
+
|
|
|
grid.OnDefineFilter += (t) => new Filter<StockMovement>(x => x.JobRequisitionItem.ID).IsEqualTo(requiID);
|
|
|
var window = DynamicGridUtils.CreateGridWindow("Stock movements", grid);
|
|
|
window.ShowDialog();
|