Class BaseGridAnyRelatedAnyCollectionController<T>
The base generic grid controller which works with the IBaseGridAnyRelatedCollection<T> view and displays an entity type as rows in the grid that are all related to an other object
This is the main base controller for creating grids, and dynamically creating their columns, for any entity in the system that is related to another object. It is different from BaseGridRelatedAnyCollectionController<TSingleItem, TCollection> or BaseGridRelatedCollectionController<TSingleItem, TCollection> as that single item type must be the same, where as this can have a parent that can be of different types allowing it to work against any entity parent
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 BaseGridAnyRelatedAnyCollectionController<T> : BaseGridControllerAny<T>, IBaseGridController, ICollectionExportable, INewGridItemImplementor<T>, ICopyGridItemImplementor<T>, IGrid, IDeleteGridItemImplementor<T>, ISearchController, IModelViewController
Type Parameters
Name | Description |
---|---|
T | An entity type inheriting from IBaseEntity that are all related to the SingleItem |
Constructors
BaseGridAnyRelatedAnyCollectionController(IBaseGridAnyRelatedAnyCollection<T>)
Creates a new default grid view any related controller with the specified instance of a default grid any related view
Declaration
public BaseGridAnyRelatedAnyCollectionController(IBaseGridAnyRelatedAnyCollection<T> view)
Parameters
Type | Name | Description |
---|---|---|
IBaseGridAnyRelatedAnyCollection<T> | view | The instance of the default grid any related view in the client application |
Properties
CollectionRelationshipColumnName
This is the property on the T
entities that holds a relationship value that points to the
SingleItem type
This controller will automatically use that to filter the correct entities for the grid in AlterQuery(QueryableExecuter<T>)
Declaration
public abstract string CollectionRelationshipColumnName { get; }
Property Value
Type | Description |
---|---|
string |
CollectionRelationshipColumnNameLabel
Holds the label column for the CollectionRelationshipColumnName
Declaration
public virtual string CollectionRelationshipColumnNameLabel { get; }
Property Value
Type | Description |
---|---|
string |
PopulateNewFromLookupColumnName
Returns OpenFromRelatedColumnName
Declaration
public override string PopulateNewFromLookupColumnName { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
SingleItem
The single item this grid is being displayed against and that all entities of type T
in the
grid are related to
Declaration
public IBaseEntity SingleItem { get; }
Property Value
Type | Description |
---|---|
IBaseEntity |
Methods
AlterQuery(QueryableExecuter<T>)
Additionally alters the base query alteration by ensuring all entities returned are related to the SingleItem by having their CollectionRelationshipColumnName have the same value as the SingleItem ID
Declaration
protected override QueryableExecuter<T> AlterQuery(QueryableExecuter<T> query)
Parameters
Type | Name | Description |
---|---|---|
QueryableExecuter<T> | query | The existing query to return all the results that will populate the grid |
Returns
Type | Description |
---|---|
QueryableExecuter<T> | An altered query that also ensures all entities returned are related to the SingleItem by having their CollectionRelationshipColumnName have the same value as the SingleItem ID |
Overrides
GetGridController(IBaseGridAnyRelatedAnyCollection<T>)
Creates the new default grid related view any controller with the specified instance of a default grid any related view
Declaration
public static BaseGridAnyRelatedAnyCollectionController<T> GetGridController(IBaseGridAnyRelatedAnyCollection<T> view)
Parameters
Type | Name | Description |
---|---|---|
IBaseGridAnyRelatedAnyCollection<T> | view | The instance of the default grid any related view in the client application |
Returns
Type | Description |
---|---|
BaseGridAnyRelatedAnyCollectionController<T> | A new default grid view any related controller with the specified instance of a default grid any related view |
UpdateNewItem(T)
Updates any new item created in this grid to also have the CollectionRelationshipColumnName property hold the value of the SingleItem ID
Declaration
protected override Task UpdateNewItem(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The new item created for this grid |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |