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: ClientCore.dll
Syntax
public abstract class BaseGridController<T> : BaseGridControllerAny<T>, IBaseGridController, IModelViewController, ICollectionExportable, INewGridItemImplementor<T>, ICopyGridItemImplementor<T>, IGrid, IDeleteGridItemImplementor<T> 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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
Overrides
CopyItemHelper
Returns a standard CopyItemDescriptor<T> for the entity type T
Declaration
protected override ICopyItemHelper<T> CopyItemHelper { get; }
Property Value
Type | Description |
---|---|
ICopyItemHelper<T> |
Overrides
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 |
---|---|
System.Boolean |
Methods
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 intial 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 intial 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 |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.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
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 |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |