Class DataSourceSearchController
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Controllers
Assembly: LemonEdge.ClientEntities.dll
Syntax
public class DataSourceSearchController : BaseGridControllerAny<IDataSourceResult>, IBaseGridController, ICollectionExportable, INewGridItemImplementor<IDataSourceResult>, ICopyGridItemImplementor<IDataSourceResult>, IGrid, IDeleteGridItemImplementor<IDataSourceResult>, ISearchController, IModelViewController
Constructors
DataSourceSearchController(IBaseGrid<IDataSourceResult>)
Declaration
public DataSourceSearchController(IBaseGrid<IDataSourceResult> view)
Parameters
Type | Name | Description |
---|---|---|
IBaseGrid<IDataSourceResult> | view |
Properties
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
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
OnlyExportGrid
Indicates when performing a stadard data export that the data should only be exported from the grid itself, and not re-run any query
The default is false
Declaration
public override bool OnlyExportGrid { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Methods
AlterColumnInfo(ControlDisplayInfo)
Provides an inheriting controller the opportunity to alter the specified column before it is added to the IBaseGrid<T>
This is used in conjunction with columns defined via ColumnNames(), rather than Columns() which explicitly defines all information
The default operation provides a CustomComboItems if the column is against a property that is a link to an entity type (IsEntityLink)Declaration
protected override void AlterColumnInfo(ControlDisplayInfo info)
Parameters
Type | Name | Description |
---|---|---|
ControlDisplayInfo | info | The definition of the column that can be updated before being created in the IBaseGrid<T> |
Overrides
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
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<IDataSourceResult>> GetGridSourceItems()
Returns
Type | Description |
---|---|
Task<IEnumerable<IDataSourceResult>> | 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 IDataSourceResult 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(IDataSourceResult)
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(IDataSourceResult rowItem)
Parameters
Type | Name | Description |
---|---|---|
IDataSourceResult | rowItem | The item to open by the system |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |