Class BaseGridController<T>
The base generic grid controller which works with the IBaseGrid<T> view and displays an entity type as rows in the grid
This is the main base controller for creating grids, and dynamically creating their columns, for any entity in the system. The BaseGridControllerAny<T> is used objects that are not entities inheriting from IBaseEntity
Both this controller and the BaseDefaultSingleViewController<T> view have a similar mechanism for creating controls dynamically within the UIInheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Core
Assembly: LemonEdge.ClientCore.dll
Syntax
public abstract class BaseGridController<T> : BaseGridControllerAny<T>, IBaseGridController, ICollectionExportable, INewGridItemImplementor<T>, ICopyGridItemImplementor<T>, IGrid, IDeleteGridItemImplementor<T>, ISearchController, IModelViewController where T : IBaseEntity
Type Parameters
Name | Description |
---|---|
T | An entity type inheriting from IBaseEntity |
Constructors
BaseGridController(IBaseGrid<T>)
Creates a new default grid view controller with the specified instance of a default grid view
Declaration
public BaseGridController(IBaseGrid<T> view)
Parameters
Type | Name | Description |
---|---|---|
IBaseGrid<T> | view | The instance of the default grid view in the client application |
Properties
AllowCopyCommand
Indicates that by default selected entities can be copied by the user with the copy command
Declaration
public override bool AllowCopyCommand { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
AllowDeleteCommand
Indicates that by default selected entities can be deleted by the user with the delete command
Declaration
public override bool AllowDeleteCommand { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
AllowIDFilter
If true indicates that the results of this grid can be altered by parameters of type DisplayableItemDescriptorForCollectionParams against the ItemParams
The default is true, but is overridden for grids that display sub sets of information related to other items
Declaration
protected virtual bool AllowIDFilter { get; }
Property Value
Type | Description |
---|---|
bool |
AllowNewCommand
Indicates that by default entities can be created by the user with the new command
Declaration
public override bool AllowNewCommand { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
AllowOpenCommand
Indicates that by default selected entities can be opened by the user with the open command
Declaration
public override bool AllowOpenCommand { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
CopyItemHelper
Returns a standard CopyItemDescriptor<T><T> for the entity type T
Declaration
protected override ICopyItemHelper<T> CopyItemHelper { get; }
Property Value
Type | Description |
---|---|
ICopyItemHelper<T> |
Overrides
HasGlobalFilter
Declaration
public bool HasGlobalFilter { get; }
Property Value
Type | Description |
---|---|
bool |
NewItemHelper
Returns a standard NewItemDescriptor<T> for the entity type T
Declaration
protected override INewItemHelper<T> NewItemHelper { get; }
Property Value
Type | Description |
---|---|
INewItemHelper<T> |
Overrides
OpenInSameContext
Indicates that opening an item should always open in the same context. By default this is false
Declaration
public virtual bool OpenInSameContext { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
AddParameterFilterToQuery(QueryableExecuter<T>, QueryableFilter)
Declaration
protected virtual QueryableExecuter<T> AddParameterFilterToQuery(QueryableExecuter<T> query, QueryableFilter filter)
Parameters
Type | Name | Description |
---|---|---|
QueryableExecuter<T> | query | |
QueryableFilter | filter |
Returns
Type | Description |
---|---|
QueryableExecuter<T> |
AddParameterIDFilterToQuery(QueryableExecuter<T>, IEnumerable<Guid>)
Declaration
protected virtual QueryableExecuter<T> AddParameterIDFilterToQuery(QueryableExecuter<T> query, IEnumerable<Guid> ids)
Parameters
Type | Name | Description |
---|---|---|
QueryableExecuter<T> | query | |
IEnumerable<Guid> | ids |
Returns
Type | Description |
---|---|
QueryableExecuter<T> |
ConvertParameterItemsFilterToItems(IEnumerable<IBaseEntity>)
Declaration
protected virtual IEnumerable<T> ConvertParameterItemsFilterToItems(IEnumerable<IBaseEntity> items)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IBaseEntity> | items |
Returns
Type | Description |
---|---|
IEnumerable<T> |
GetCopyGridCommand()
Provdies the copy command required to open any entity in the system
Declaration
protected override ViewCommand GetCopyGridCommand()
Returns
Type | Description |
---|---|
ViewCommand | The CopyGridItem<T> command |
Overrides
GetCreationQuery()
Returns the main initial query to return all entities of type T
Includes any filtering requested from parameters of type DisplayableItemDescriptorForCollectionParams against the ItemParams if AllowIDFilter is true
Also applies any paging requiredDeclaration
protected virtual QueryableExecuter<T> GetCreationQuery()
Returns
Type | Description |
---|---|
QueryableExecuter<T> | The main initial query to return all entities of type |
GetCurrentQuery()
Returns the GetCreationQuery() for this entity type, with the AlterQuery(QueryableExecuter<T>) and ApplyGridSettingsToFilter(QueryableExecuter) applied
Declaration
public QueryableExecuter<T> GetCurrentQuery()
Returns
Type | Description |
---|---|
QueryableExecuter<T> | The GetCreationQuery() for this entity type, with the AlterQuery(QueryableExecuter<T>) and ApplyGridSettingsToFilter(QueryableExecuter) applied |
GetGridSourceItems()
Executes the query (GetCurrentQuery()) for the entities required in this grid, sets the total count (as it is different due to paging), and returns the results
Declaration
public override Task<IEnumerable<T>> GetGridSourceItems()
Returns
Type | Description |
---|---|
Task<IEnumerable<T>> | The result of executing the GetCurrentQuery() to return all the entities that should be displayed in this grid |
Overrides
GetInternalDescriptor()
Returns the descriptor for the entity type T
Declaration
protected override EntityDescriptor GetInternalDescriptor()
Returns
Type | Description |
---|---|
EntityDescriptor | The descriptor for the entity type |
Overrides
GetOpenGridCommand()
Provdies the open command required to open any entity in the system
Declaration
protected override ViewCommand GetOpenGridCommand()
Returns
Type | Description |
---|---|
ViewCommand | The OpenGridItem<T> command |
Overrides
GetQueryForExcelResults()
The query for the results to export from this grid is the same as those to display the items -> GetCurrentQuery()
Declaration
public override QueryableExecuter GetQueryForExcelResults()
Returns
Type | Description |
---|---|
QueryableExecuter | The query for the results to export from this grid is the same as those to display the items -> GetCurrentQuery() |
Overrides
LoadExtendedData(IEnumerable<T>)
Declaration
protected Task LoadExtendedData(IEnumerable<T> baseData)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | baseData |
Returns
Type | Description |
---|---|
Task |
LoadExtendedItem(Type, object)
Declaration
public override object LoadExtendedItem(Type t, object gridRowItem)
Parameters
Type | Name | Description |
---|---|---|
Type | t | |
object | gridRowItem |
Returns
Type | Description |
---|---|
object |
Overrides
OnOpenRowItem(T)
Opens the specified entity item in a new IModelLayoutDisplayer.
Either opens the item itself, or a related item if OpenFromRelatedColumnName is populated
Declaration
public override Task OnOpenRowItem(T rowItem)
Parameters
Type | Name | Description |
---|---|---|
T | rowItem | The specified item to open in a new IModelLayoutDisplayer |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
Overrides
ProcessCustomCommandResult(object)
Declaration
protected override Task ProcessCustomCommandResult(object result)
Parameters
Type | Name | Description |
---|---|---|
object | result |
Returns
Type | Description |
---|---|
Task |