|
@@ -439,6 +439,13 @@ public static class DynamicGridUtils
|
|
|
return (Activator.CreateInstance(type) as IDynamicGrid)
|
|
|
?? throw new ArgumentException("Argument must be a type of IDynamicGrid", nameof(gridType));
|
|
|
}
|
|
|
+ public static DynamicGrid<TEntity> CreateDynamicGrid<TEntity>(Type gridType)
|
|
|
+ where TEntity : BaseObject, new()
|
|
|
+ {
|
|
|
+ var type = FindDynamicGrid(gridType, typeof(TEntity));
|
|
|
+ return (Activator.CreateInstance(type) as DynamicGrid<TEntity>)
|
|
|
+ ?? throw new ArgumentException("Argument must be a type of IDynamicGrid", nameof(gridType));
|
|
|
+ }
|
|
|
|
|
|
private static Dictionary<Type, Type[]> _dynamicGrids = new();
|
|
|
|