Class BaseGridRelatedCollectionController<SI, T>
The base generic grid controller which works with the IBaseGridRelatedCollection<SI, T> view and displays an entity type as rows in the grid that are all related to an other entity
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 entity. It is different from BaseGridRelatedAnyCollectionController<SI, T> as that can display any object, and BaseGridControllerAny<T> as that can have multiple different types of parent it is related to where as this must be of type SI
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Core
Assembly: ClientCore.dll
Syntax
public abstract class BaseGridRelatedCollectionController<SI, T> : BaseGridController<T>, IBaseGridController, IModelViewController, ICollectionExportable, INewGridItemImplementor<T>, ICopyGridItemImplementor<T>, IGrid, IDeleteGridItemImplementor<T> where SI : IBaseEntity where T : IBaseEntity
Type Parameters
Name | Description |
---|---|
SI | An entity type inheriting from IBaseEntity |
T | An entity type that are all related to the SingleItem in the query |
Constructors
BaseGridRelatedCollectionController(IBaseGridRelatedCollection<SI, T>)
Creates a new BaseGridRelatedCollectionController with the specified instance of a default grid related collection view
Declaration
public BaseGridRelatedCollectionController(IBaseGridRelatedCollection<SI, T> view)
Parameters
Type | Name | Description |
---|---|---|
IBaseGridRelatedCollection<SI, T> | view | The instance of the default grid related collection view in the client application |
Properties
AllowIDFilter
Indicates this grids results are not filtered by any DisplayableItemDescriptorForCollectionParams, as it is not a top level collection of items
Declaration
protected override bool AllowIDFilter { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
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 |
---|---|
System.String |
PopulateNewFromLookupColumnName
Returns OpenFromRelatedColumnName
Declaration
public override string PopulateNewFromLookupColumnName { get; }
Property Value
Type | Description |
---|---|
System.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 SI SingleItem { get; }
Property Value
Type | Description |
---|---|
SI |
Methods
AddRelationshipJoin(QueryableExecuter<T>)
Alters the provided query by ensuring all entities returned are related to the SingleItem by having their CollectionRelationshipColumnName have the same value as the SingleItem ID
This can be overidden to customise how the entities of type T
are precisely related to the SingleItem if not directly through that join
Declaration
protected virtual QueryableExecuter<T> AddRelationshipJoin(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 |
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
This is achieved via AddRelationshipJoin(QueryableExecuter<T>) which can be overidden to customise how the entities of type T
are precisely related to the SingleItem if not directly through that join
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
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 |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |