Class CanvasItemsController
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Controllers
Assembly: LemonEdge.ClientEntities.dll
Syntax
public class CanvasItemsController : BaseGridRelatedAnyCollectionController<ICanvas, ICanvasItem>, IBaseGridController, ICollectionExportable, INewGridItemImplementor<ICanvasItem>, ICopyGridItemImplementor<ICanvasItem>, IGrid, IDeleteGridItemImplementor<ICanvasItem>, ISearchController, IModelViewController
Constructors
CanvasItemsController(IBaseGridRelatedCollection<ICanvas, ICanvasItem>)
Declaration
public CanvasItemsController(IBaseGridRelatedCollection<ICanvas, ICanvasItem> view)
Parameters
| Type | Name | Description |
|---|---|---|
| IBaseGridRelatedCollection<ICanvas, ICanvasItem> | view |
Properties
AllowDeleteCommand
Indicates the command to allow selected rows to be deleted by the user is included in the InitCommands(IList<ViewCommand>)
The default is false
Declaration
public override bool AllowDeleteCommand { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
AllowOpenCommand
Indicates the command to allow selected rows to be opened by the user is included in the InitCommands(IList<ViewCommand>)
The default is false
Declaration
public override bool AllowOpenCommand { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
CollectionRelationshipColumnName
This is the property on the ICanvasItem 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<TCollection>)
Declaration
public override string CollectionRelationshipColumnName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
ContextHelpURL
An optional associated url of a help file for the view this controller works with
Declaration
public override string ContextHelpURL { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
DefaultColumnGroupIndexes
Groupings for columns to be grouped by and items have aggregation summaries of
Declaration
public override IEnumerable<int> DefaultColumnGroupIndexes { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<int> |
Overrides
LoadPager
Indicates if a pager should be used at all - default true. If not then all results will always be loaded
Declaration
public override bool LoadPager { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
SelectedItemForSubViews
Returns the first selected item in the IBaseGrid<T> for any sub-views
Declaration
public override object SelectedItemForSubViews { get; }
Property Value
| Type | Description |
|---|---|
| object |
Overrides
Methods
Columns()
Provides a list of all the columns to be created against the IBaseGrid<T> by this control
The default behaviour is to enumerate ColumnNames() and create the list automatically. You can also override AlterColumnInfo(ControlDisplayInfo) to provide more detail for specific columns
Alternatively you can override this to explicitly define themDeclaration
public override IEnumerable<ControlDisplayInfo> Columns()
Returns
| Type | Description |
|---|---|
| IEnumerable<ControlDisplayInfo> | A list of all the columns to be created against the IBaseGrid<T> by this control |
Overrides
GetDeleteCommand()
Returns the command for deleting an item in the grid
Declaration
protected override ViewCommand GetDeleteCommand()
Returns
| Type | Description |
|---|---|
| ViewCommand | The command for deleting an item in the grid |
Overrides
GetGridSourceItems()
A function that must be implemented by inheriting classes that returns the list of items to be displayed against the grid given all active filters, sorting, searches, paging, etc
Declaration
public override Task<IEnumerable<ICanvasItem>> GetGridSourceItems()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<ICanvasItem>> | A list of items to be displayed against the grid given all active filters, sorting, searches, paging, etc |
Overrides
GetOpenGridCommand()
Returns the command for opening the grid item.
Not implemented for this controller as the ICanvasItem may not be an entity type it knows how to open. Must be implemented by an inheriting controller.
Declaration
protected override ViewCommand GetOpenGridCommand()
Returns
| Type | Description |
|---|---|
| ViewCommand | The command for opening the grid item. |
Overrides
InitCommands(IList<ViewCommand>)
Adds the following commands, if the associated AllowXXXCommand property returns true: A public toggle, multi-select row, open, column visiblitiy, transfer visible, search, view cancelled, view system, export, new, copy, move up/down, xml export, and delete commands
Declaration
protected override void InitCommands(IList<ViewCommand> commands)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<ViewCommand> | commands | The initial set of commands for this view |
Overrides
OnOpenRowItem(ICanvasItem)
A method called by the system to open the specified data item from the grid
The defult implementation throws an error, this must be implemented by an inheriting controller if the AllowOpenCommand is true
Declaration
public override Task OnOpenRowItem(ICanvasItem rowItem)
Parameters
| Type | Name | Description |
|---|---|---|
| ICanvasItem | rowItem | The item to open by the system |
Returns
| Type | Description |
|---|---|
| Task | A task indicating the completion of the operation |
Overrides
OnSelectedItemsChanged(IEnumerable<ICanvasItem>)
Declaration
protected override Task OnSelectedItemsChanged(IEnumerable<ICanvasItem> selectedItems)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ICanvasItem> | selectedItems |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
OpenItems(IEnumerable<ICanvasItem>)
Declaration
public Task OpenItems(IEnumerable<ICanvasItem> items)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ICanvasItem> | items |
Returns
| Type | Description |
|---|---|
| Task |
ShouldDisplayItem(object)
Indicates if this item should be displayed against this view
By default this returns true if the item is not null or DisplayIfNull is true
Declaration
protected override bool ShouldDisplayItem(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| object | item | The item to check if it should be displayed against the View |
Returns
| Type | Description |
|---|---|
| bool | True if this item should be displayed against this view |