Class BaseGridControllerAny<T>
The base generic grid controller which works with the IBaseGrid<T> view and displays any type of object as rows in the grid
This is the main base controller for creating grids, and dynamically creating their columns, for any object in the system. The BaseGridController<T> is used specifically for entities inheriting from IBaseEntity
Both this controller and the BaseDefaultSingleViewController<T> view have a similar mechanism for creating controls dynamically within the UIImplements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Core
Assembly: LemonEdge.ClientCore.dll
Syntax
public abstract class BaseGridControllerAny<T> : BaseGridController, IBaseGridController, ICollectionExportable, INewGridItemImplementor<T>, ICopyGridItemImplementor<T>, IGrid, IDeleteGridItemImplementor<T>, ISearchController, IModelViewController
Type Parameters
Name | Description |
---|---|
T | The type of item displayed in the grid rows. Can be of any object type. Entities inheriting from IBaseEntity are handled by the BaseGridController<T> |
Constructors
BaseGridControllerAny(IBaseGrid<T>)
Creates a new default grid any view controller with the specified instance of a default grid view
Declaration
public BaseGridControllerAny(IBaseGrid<T> view)
Parameters
Type | Name | Description |
---|---|---|
IBaseGrid<T> | view | The instance of the default grid view in the client application |
Properties
AddStandardColumns
The system adds standard columns to every grid that are initially hidden, but can be viewed by the user. These columns are returned from GetStandardExtraColumns(string)
These are columns common to every entity in the system: LastUpdated,
ModifiedByUserID, CanvasID, and
Status, CancelledID,
CorrectedByID (if T
is of type
ITransactionalEntity)
ID
T
is an entity type deriving from
IBaseEntity
Declaration
protected virtual bool AddStandardColumns { get; }
Property Value
Type | Description |
---|---|
bool |
AllowClearSearchSortFilter
Indicates the command to clear all search, sorts and filters on the grid. InitCommands(IList<ViewCommand>)
The default is true
Declaration
public virtual bool AllowClearSearchSortFilter { get; }
Property Value
Type | Description |
---|---|
bool |
AllowColumnSelection
Indicates the command to allow columns to be made visibile/hidden by the user is included in the InitCommands(IList<ViewCommand>)
The default is true
Declaration
public virtual bool AllowColumnSelection { get; }
Property Value
Type | Description |
---|---|
bool |
AllowCopyCommand
Indicates the command to allow selected rows to be copied by the user is included in the InitCommands(IList<ViewCommand>)
The default is false
Declaration
public virtual bool AllowCopyCommand { get; }
Property Value
Type | Description |
---|---|
bool |
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 virtual bool AllowDeleteCommand { get; }
Property Value
Type | Description |
---|---|
bool |
AllowExcelExport
Indicates the command to allow the grid data to be exported by the user is included in the InitCommands(IList<ViewCommand>)
The default is true
Declaration
public virtual bool AllowExcelExport { get; }
Property Value
Type | Description |
---|---|
bool |
AllowMultipleSelect
Indicates the command to allow multiple rows to be selected at once in the grid by the user is included in the InitCommands(IList<ViewCommand>)
The default is true
Declaration
public virtual bool AllowMultipleSelect { get; }
Property Value
Type | Description |
---|---|
bool |
AllowNewCommand
Indicates the command to allow new items to be created by the user is included in the InitCommands(IList<ViewCommand>)
The default is false if NewItemHelper is equal to null
Declaration
public virtual bool AllowNewCommand { get; }
Property Value
Type | Description |
---|---|
bool |
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 virtual bool AllowOpenCommand { get; }
Property Value
Type | Description |
---|---|
bool |
AllowPageSizeCommand
Indicates the command to allow resizing of the result set per page. InitCommands(IList<ViewCommand>)
The default is true
Declaration
public virtual bool AllowPageSizeCommand { get; }
Property Value
Type | Description |
---|---|
bool |
AllowPublicToggleCommand
Indicates the command to allow results to include user specific items only, or public as well, is included in the InitCommands(IList<ViewCommand>)
The default is true if type T
implements
IUserSpecific
Declaration
public virtual bool AllowPublicToggleCommand { get; }
Property Value
Type | Description |
---|---|
bool |
AllowSearchCommand
Indicates the command to allow the default search of text by the user is included in the InitCommands(IList<ViewCommand>)
The default is true
Declaration
public virtual bool AllowSearchCommand { get; }
Property Value
Type | Description |
---|---|
bool |
AllowSequencing
Indicates the command to allow selected rows to be moved up/down by the user is included in the InitCommands(IList<ViewCommand>)
The default is true if one of the properties against the type T
is defined as having
SequenceStart
Declaration
public virtual bool AllowSequencing { get; }
Property Value
Type | Description |
---|---|
bool |
AllowXMLImportExport
Indicates the command to allow the xml export of the data by the user is included in the InitCommands(IList<ViewCommand>)
The default is true if the type T
derives from ISetCopier
Declaration
public virtual bool AllowXMLImportExport { get; }
Property Value
Type | Description |
---|---|
bool |
AutoOpenNewItemInTab
Indicates when creating a new item in the grid that it should automatically be opened in a new tab as well
The default is true if the type T
is an entity that is not a
IsStandingDataEntity
Declaration
public virtual bool AutoOpenNewItemInTab { get; }
Property Value
Type | Description |
---|---|
bool |
AutoSelectFirstRow
Indicates the first row of the results in this grid should automatically be selected by the view when the data is loaded and displayed
The default is false
Declaration
protected virtual bool AutoSelectFirstRow { get; }
Property Value
Type | Description |
---|---|
bool |
CanCreateNew
Indicates if the user can create new items in the grid
The default implementation is true, allowing specific controller implementations to provide override values
Declaration
public virtual bool CanCreateNew { get; }
Property Value
Type | Description |
---|---|
bool |
CanUserSelect
Indicates whether user can select rows
The default is true
Declaration
public virtual bool CanUserSelect { get; }
Property Value
Type | Description |
---|---|
bool |
CollectionType
Indicates the collection type is of type T
Declaration
public override Type CollectionType { get; }
Property Value
Type | Description |
---|---|
Type |
Overrides
CopyItemHelper
Provides the helper class for copying existing items in the grid
Not implemented for this controller as the T
may not be an entity type it knows how to
copy. Must be implemented by an inheriting controller.
Declaration
protected virtual ICopyItemHelper<T> CopyItemHelper { get; }
Property Value
Type | Description |
---|---|
ICopyItemHelper<T> |
CurrentGridItems
An enumeration of the currently loaded items to be displayed in this IBaseGrid<T>
Declaration
public override IEnumerable CurrentGridItems { get; }
Property Value
Type | Description |
---|---|
IEnumerable |
Overrides
CurrentItems
An observable enumeration of the currently loaded items to be displayed in this IBaseGrid<T>
Declaration
public ObservableCollection<T> CurrentItems { get; }
Property Value
Type | Description |
---|---|
ObservableCollection<T> |
DefaultOrOverridenRowCount
Declaration
public int DefaultOrOverridenRowCount { get; }
Property Value
Type | Description |
---|---|
int |
DefaultRowCount
The default number of rows that should be displayed in the grid before the grid will start paging the results
The default number is DisplayableItemDescriptor.UIRestrictedMaxCollectionItems which can be set depending on the client application. For instance mobiles can override this to a smaller number
The default if DisplayableItemDescriptor.UIRestrictedMaxCollectionItems is not set is 500Declaration
public virtual int DefaultRowCount { get; }
Property Value
Type | Description |
---|---|
int |
Descriptor
Returns the entity descriptor for this object if any. If the type of T
is a non
IBaseEntity item then this will return null
Declaration
public EntityDescriptor Descriptor { get; }
Property Value
Type | Description |
---|---|
EntityDescriptor | The entity descriptor for this object if any. If the type of |
ExcelExportCommand
Provides the command used to export data for this grid
Declaration
protected virtual ViewCommand ExcelExportCommand { get; }
Property Value
Type | Description |
---|---|
ViewCommand |
Filters
The current filters applied to the IBaseGrid<T>
Declaration
public IEnumerable<QueryableFilter> Filters { get; }
Property Value
Type | Description |
---|---|
IEnumerable<QueryableFilter> |
GridView
The IBaseGrid<T> view instance this controller is working with
Declaration
public IBaseGrid<T> GridView { get; }
Property Value
Type | Description |
---|---|
IBaseGrid<T> |
ItemCellDisableCell
Declaration
public virtual Func<object, string, string, bool> ItemCellDisableCell { get; }
Property Value
Type | Description |
---|---|
Func<object, string, string, bool> |
ItemRowColorProperty
Indicate the name of the property on the row item that holds a Color to color the row with
Declaration
public virtual string ItemRowColorProperty { get; }
Property Value
Type | Description |
---|---|
string |
LimitPagesToTotal
Declaration
public virtual bool LimitPagesToTotal { get; }
Property Value
Type | Description |
---|---|
bool |
ListenToChanges
Indicates if this controller should listen to every item change.
Default is true as we want to provide the ability to bulk update multiple selected rows if a value changes
Declaration
public override bool ListenToChanges { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
NewItemHelper
Provides the helper class for creating new items in the grid.
Not implemented for this controller as the T
may not be an entity type it knows how to
create. Must be implemented by an inheriting controller.
Declaration
protected virtual INewItemHelper<T> NewItemHelper { get; }
Property Value
Type | Description |
---|---|
INewItemHelper<T> |
OpenFromRelatedColumnName
Indicates when opening a selected item in the grid, that it should not open the item itself, but rather the item referred to by the value held against this property on the type
The default value is null, indicating it should just open the item itself, but can be overridden by a derived controller to open other related items by default
Declaration
public virtual string OpenFromRelatedColumnName { get; }
Property Value
Type | Description |
---|---|
string |
PagerRequired
Indicates if paging is required in the query to be executed. True if TotalCount > DefaultRowCount
Declaration
public override bool PagerRequired { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
PopulateNewFromLookupColumnName
Indicates when creating a new item the system should create a popup showing a selection of items from this property
relationship on type T
, that will automatically be set for the new item
For each relationship entity selected the system will call the callback in the GetLookupIDsForNewItems(Func<IBaseEntity, Task>) function
The default implementation is null, indicating a new item is just created as is, but can be overridden by inheriting controllers to force relationship selections first before creating itemsDeclaration
public virtual string PopulateNewFromLookupColumnName { get; }
Property Value
Type | Description |
---|---|
string |
PopulateNewFromLookupRelationship
If PopulateNewFromLookupColumnName is set this by default returns the relationship to use for the popup for that column, but allows it to be overridden
Declaration
public virtual EntityRelationship PopulateNewFromLookupRelationship { get; }
Property Value
Type | Description |
---|---|
EntityRelationship |
PreventDuplicateLookupIDs
If PopulateNewFromLookupColumnName is set and this is true then the system will ensure that new items are only created for selected entities that there are no current existing items with those values too
In other words this prevents duplication of items in the collection that have the same value for the
PopulateNewFromLookupColumnName property on entity type T
Declaration
public virtual bool PreventDuplicateLookupIDs { get; }
Property Value
Type | Description |
---|---|
bool |
RowPreviewColumns
The columns that should be automatically used as the preview columns shown when scrolling through all the data in the grid
By default this will use the column setup as the LabelColumn if the item is an entity, otherwise no column will be used by default
Declaration
public virtual IEnumerable<ControlDisplayInfo> RowPreviewColumns { get; }
Property Value
Type | Description |
---|---|
IEnumerable<ControlDisplayInfo> |
SearchElements
Declaration
public IEnumerable<(string Name, string GroupKey, string FilterName, bool Visible)> SearchElements { get; }
Property Value
Type | Description |
---|---|
IEnumerable<(string Name, string GroupKey, string FilterName, bool Visible)> |
SearchGroups
Declaration
public IEnumerable<GridColumnGroup> SearchGroups { get; }
Property Value
Type | Description |
---|---|
IEnumerable<GridColumnGroup> |
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
ShowCheckboxForMultiSelect
The flag for checkbox display to multiselect grid items
Declaration
protected virtual bool ShowCheckboxForMultiSelect { get; }
Property Value
Type | Description |
---|---|
bool |
ShowFrozenColumnsSplitter
Indicates whether the frozen columns splitter is shown
The default is true
Declaration
public virtual bool ShowFrozenColumnsSplitter { get; }
Property Value
Type | Description |
---|---|
bool |
ShowGrouping
Indicates whether grouping area is shown above grid (and grouping is therefore enabled)
The default is true
Declaration
public virtual bool ShowGrouping { get; }
Property Value
Type | Description |
---|---|
bool |
ShowVerticalGridLines
Indicates whether vertical grid lines are shown
The default is true
Declaration
public virtual bool ShowVerticalGridLines { get; }
Property Value
Type | Description |
---|---|
bool |
Sortings
The current sortings applied to the IBaseGrid<T>
Declaration
public IEnumerable<QueryableSort> Sortings { get; }
Property Value
Type | Description |
---|---|
IEnumerable<QueryableSort> |
StandardColumnsUniqueGroupKey
All the standard columns created by GetStandardExtraColumns(string) have a GroupKey provided by this value
By default this is "", but can be overriden if you are creating ColumnGroups() for the grid and want the standard columns to belong to a group too
Declaration
protected virtual string StandardColumnsUniqueGroupKey { get; }
Property Value
Type | Description |
---|---|
string |
TogglerZeroColumn
The toggler for switching between a grid showing only columns that have non-zero numbers, and all number columns
Declaration
public override IHasToggleStatus TogglerZeroColumn { get; }
Property Value
Type | Description |
---|---|
IHasToggleStatus |
Overrides
TotalCount
The total number of results that are available for this grid.
This may not be the total amount of rows seen in the grid if theDefaultRowCount is less than this amount
In which case the IBaseGrid<T> will be paging the results in the gridDeclaration
public int TotalCount { get; }
Property Value
Type | Description |
---|---|
int |
TotalPageCount
the total number of pages that are required to move through the TotalCount of results if the grid is paging the results
Declaration
public int TotalPageCount { get; }
Property Value
Type | Description |
---|---|
int |
TransferColToggler
The toggler for showing/hiding TransferID column for a transactional item
Declaration
public IHasToggleStatus TransferColToggler { get; set; }
Property Value
Type | Description |
---|---|
IHasToggleStatus |
UpdateSubViewsWhenMultipleRowSelectionChanges
Normally sub views are updated when the selection changes. If multiple rows are selected the single item passed to sub views can be the same in which case by default they will not be refreshed. Setting this to true will mean sub views are always refreshed when multiple rows are selected
Declaration
protected virtual bool UpdateSubViewsWhenMultipleRowSelectionChanges { get; }
Property Value
Type | Description |
---|---|
bool |
UserOverridenPagingAmount
Declaration
public int? UserOverridenPagingAmount { get; set; }
Property Value
Type | Description |
---|---|
int? |
Methods
AddCol(short, ControlDisplayInfoLight, EntityDescriptor)
Automatically takes a colInfo
light definition and creates a corrosponding detailed
ControlDisplayInfo for you
This automatically contains any appropriate relationship info for you
Declaration
protected ControlDisplayInfo AddCol(short i, ControlDisplayInfoLight colInfo, EntityDescriptor desc)
Parameters
Type | Name | Description |
---|---|---|
short | i | The index of this column in the grid order of columns |
ControlDisplayInfoLight | colInfo | The light definition of the column you need a more detailed definition of |
EntityDescriptor | desc | The optional entity descriptor for the type |
Returns
Type | Description |
---|---|
ControlDisplayInfo | A detailed description of the column to create |
AddItem(T)
Adds the specified item to the CurrentItems and selects it in the grid
Declaration
public Task AddItem(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
Returns
Type | Description |
---|---|
Task |
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 virtual 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> |
AlterLoadedItems(IEnumerable<T>)
Provides a mechanism for an inhetiring class to alter all the loaded items before they are sent to the GridView to be displayed
Declaration
protected virtual Task<IEnumerable<T>> AlterLoadedItems(IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | items | The items loaded for display into the GridView |
Returns
Type | Description |
---|---|
Task<IEnumerable<T>> |
AlterQuery(QueryableExecuter<T>)
Provides the inheriting controller an opportunity to modify the query used to load the data for this IBaseGrid<T>
Default implementation does nothing unless the type T
is an entity with a property with
a SequenceStart, in which case it is ordered by that
Declaration
protected virtual QueryableExecuter<T> AlterQuery(QueryableExecuter<T> query)
Parameters
Type | Name | Description |
---|---|---|
QueryableExecuter<T> | query | The query for this grid to always be altered before being executed |
Returns
Type | Description |
---|---|
QueryableExecuter<T> | The query to be used to execute results for this grid |
ApplyGridSettingsToFilter(QueryableExecuter)
Applies the sorting, and filtering currently active in the IBaseGrid<T> to the provided
query
for this type T
Declaration
protected QueryableExecuter ApplyGridSettingsToFilter(QueryableExecuter query)
Parameters
Type | Name | Description |
---|---|---|
QueryableExecuter | query | The query to apply the current grid sorting and filtering to |
Returns
Type | Description |
---|---|
QueryableExecuter | A query that also includes the current sorting and filtering from the IBaseGrid<T> along with
the original |
ApplyPaging(QueryableExecuter)
Applies the paging currently active in the IBaseGrid<T> to the provided query
for this type T
Declaration
protected QueryableExecuter ApplyPaging(QueryableExecuter executer)
Parameters
Type | Name | Description |
---|---|---|
QueryableExecuter | executer | The query to apply the current paging to |
Returns
Type | Description |
---|---|
QueryableExecuter | A query that also includes the current paging from the IBaseGrid<T> along with the original
|
CanDelete(T)
Indicates if the selected item is allowed to be deleted based on the status of the item itself
The default implementation is false, allowing specific controller implementations to provide override values
Declaration
public virtual Task<bool> CanDelete(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item to check if it can be deleted |
Returns
Type | Description |
---|---|
Task<bool> | True if the specified item can be deleted |
CanEditRowItem(T)
Indicates if the user is permitted to edit the specified row item from the state of the item itself
Declaration
public virtual bool CanEditRowItem(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item to check if the user is permitted to edit |
Returns
Type | Description |
---|---|
bool | True if the user is permitted to edit the specified row item from the state of the item itself |
CanEditRowItem(T, short)
Indicates if the user is permitted to edit the specified column for the specified row item
Declaration
public virtual bool CanEditRowItem(T item, short columnDefinitionIndex)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item to check if the user is permitted to edit |
short | columnDefinitionIndex |
Returns
Type | Description |
---|---|
bool | True if the user is permitted to edit the specified row item from the state of the item itself |
Clear()
Clears the paging information for the loaded grid items
Declaration
public override Task Clear()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
Overrides
CloseController()
Closes the grid view
Declaration
public override Task CloseController()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
Overrides
ColumnNames()
A list of all the columns to be dynamically created in the IBaseGrid<T>
This is used by the system to create the actual ControlDisplayInfo classes required from the Columns() property
You can override this to provide a simple definition of each column (combined with AlterControlInfo(ControlDisplayInfo) for more detail), or you can just override Columns() and ignore thisDeclaration
protected virtual IEnumerable<ControlDisplayInfoLight> ColumnNames()
Returns
Type | Description |
---|---|
IEnumerable<ControlDisplayInfoLight> | A list of all the columns to be dynamically created in the IBaseGrid<T> |
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
DeleteCommandIsQuickAccess()
Declaration
public virtual bool DeleteCommandIsQuickAccess()
Returns
Type | Description |
---|---|
bool |
DisplayUI()
Initializes the grid, and creates every ControlDisplayInfo in the defined Columns() and creates them on the grid
Then loads the data for the grid accounting for all view sorting, filtering, searching and paging, and loads the results into the grid as an observable collection
Declaration
public override Task DisplayUI()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
Overrides
GetCopyGridCommand()
Returns the command for copying an item in the grid
Not implemented for this controller as the T
may not be an entity type it knows how to
copy. Must be implemented by an inheriting controller.
Declaration
protected virtual ViewCommand GetCopyGridCommand()
Returns
Type | Description |
---|---|
ViewCommand | The command for copying an item in the grid |
GetDeleteCommand()
Returns the command for deleting an item in the grid
Declaration
protected virtual ViewCommand GetDeleteCommand()
Returns
Type | Description |
---|---|
ViewCommand | The command for deleting an item in the grid |
GetDownCommand()
Returns the command for moving an item down in the grid
Declaration
protected virtual ViewCommand GetDownCommand()
Returns
Type | Description |
---|---|
ViewCommand | The command for moving an item down in the grid |
GetExportableColumnInfo(IEnumerable<ColumnDescriptor>)
Returns all the information on the columns that can be exported from this grid
The default information contains the info of all Columns() in the grid
Declaration
public override Task<IEnumerable<ControlDisplayVisibilityInfo>> GetExportableColumnInfo(IEnumerable<ColumnDescriptor> visibleColumns)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ColumnDescriptor> | visibleColumns | The currently visible columns in the grid |
Returns
Type | Description |
---|---|
Task<IEnumerable<ControlDisplayVisibilityInfo>> | All the information on the columns that can be exported from this grid |
Overrides
GetGridController(IBaseGrid<T>)
Creates the new default grid view any controller with the specified instance of a default grid view
If the view has a GridViewControllerCustomViewParams parameter then this will return the BaseGridCustomController<T> for loading custom grids from a ICustomGrid definition
Declaration
public static BaseGridControllerAny<T> GetGridController(IBaseGrid<T> view)
Parameters
Type | Name | Description |
---|---|---|
IBaseGrid<T> | view | The instance of the default grid view in the client application |
Returns
Type | Description |
---|---|
BaseGridControllerAny<T> | A new default grid view any controller with the specified instance of a default grid view |
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 abstract Task<IEnumerable<T>> GetGridSourceItems()
Returns
Type | Description |
---|---|
Task<IEnumerable<T>> | A list of items to be displayed against the grid given all active filters, sorting, searches, paging, etc |
GetGridSourceItems(IEnumerable<T>, QueryableExecuterApplyType)
Returns the currentItems
with the AlterQuery(QueryableExecuter<T>) filtering
applied to the results
Declaration
public virtual IEnumerable<T> GetGridSourceItems(IEnumerable<T> currentItems, QueryableExecuterApplyType typeToApply = QueryableExecuterApplyType.All)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | currentItems | The current items to be displayed in the grid |
QueryableExecuterApplyType | typeToApply |
Returns
Type | Description |
---|---|
IEnumerable<T> | The |
GetInternalDescriptor()
Returns the entity descriptor for this object if any. If the type of T
is a non
IBaseEntity item then this will return null
Declaration
protected virtual EntityDescriptor GetInternalDescriptor()
Returns
Type | Description |
---|---|
EntityDescriptor | The entity descriptor for this object if any. If the type of |
GetItemToReselect(object)
Declaration
protected virtual object GetItemToReselect(object item)
Parameters
Type | Name | Description |
---|---|---|
object | item |
Returns
Type | Description |
---|---|
object |
GetLookupIDsForNewItems(Func<IBaseEntity, Task>)
If a PopulateNewFromLookupColumnName is set, then the system will call this method to retrieve each selected entity for the new item(s).
A new item will be created for each selected item with the PopulateNewFromLookupColumnName property set to the selected items id value
This needs to be implemented by the client application ui in GetLookupIDsForNewItems(Func<IBaseEntity, Task>)Declaration
public Task GetLookupIDsForNewItems(Func<IBaseEntity, Task> callBack)
Parameters
Type | Name | Description |
---|---|---|
Func<IBaseEntity, Task> | callBack | A callback to be invoked for each antity selected by the user for the new item(s) |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
GetNewGridCommand()
Returns the command for creating a new item in the grid
Declaration
protected virtual ViewCommand GetNewGridCommand()
Returns
Type | Description |
---|---|
ViewCommand | The command for creating a new item in the grid |
GetOpenGridCommand()
Returns the command for opening the grid item.
Not implemented for this controller as the T
may not be an entity type it knows how to
open. Must be implemented by an inheriting controller.
Declaration
protected virtual ViewCommand GetOpenGridCommand()
Returns
Type | Description |
---|---|
ViewCommand | The command for opening the grid item. |
GetPublicToggleCommand()
Provides the command used to switch the grid from including only user specific entities or ones for all users
Works for entities that implement IUserSpecificPublicToggle
Declaration
protected virtual ViewCommand GetPublicToggleCommand()
Returns
Type | Description |
---|---|
ViewCommand |
GetStandardExtraColumns(string)
Returns the system standard columns to every grid that are initially hidden, but can be viewed by the user
These are columns common to every entity in the system: LastUpdated,
ModifiedByUserID, CanvasID, and
Status, CancelledID,
CorrectedByID (if T
is of type
ITransactionalEntity), ID
Declaration
protected IEnumerable<ControlDisplayInfoLight> GetStandardExtraColumns(string uniqueGroupKey = "")
Parameters
Type | Name | Description |
---|---|---|
string | uniqueGroupKey |
Returns
Type | Description |
---|---|
IEnumerable<ControlDisplayInfoLight> |
GetUpCommand()
Returns the command for moving an item up in the grid
Declaration
protected virtual ViewCommand GetUpCommand()
Returns
Type | Description |
---|---|
ViewCommand | The command for moving an item up in the grid |
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
InitDisplay()
Provides inheriting controllers a chance to initialize the display for the IBaseGrid<T>
Declaration
protected virtual Task InitDisplay()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
IsZeroColumnColumnVisible(string)
Returns true if the specified column has any data in it that is non-zero
Declaration
protected bool IsZeroColumnColumnVisible(string colName)
Parameters
Type | Name | Description |
---|---|---|
string | colName | The name of the column to check if any of the numbers displayed in it are non-zero |
Returns
Type | Description |
---|---|
bool | True if the specified column has any data in it that is non-zero |
LoadAdditionalColumns()
Provides inheriting controllers the opportunity to load any additional columns into the grid before data is displayed against it
Declaration
protected virtual Task LoadAdditionalColumns()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
LoadExtendedItem(Type, object)
Declaration
public virtual object LoadExtendedItem(Type t, object gridRowItem)
Parameters
Type | Name | Description |
---|---|---|
Type | t | |
object | gridRowItem |
Returns
Type | Description |
---|---|
object |
MoveItemSequence(object, object)
Declaration
public override void MoveItemSequence(object fromItem, object toItem)
Parameters
Type | Name | Description |
---|---|---|
object | fromItem | |
object | toItem |
Overrides
OnOpenRowItem(T)
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 virtual Task OnOpenRowItem(T rowItem)
Parameters
Type | Name | Description |
---|---|---|
T | rowItem | The item to open by the system |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
OnSelectedItemsChanged(IEnumerable<T>)
Declaration
protected virtual Task OnSelectedItemsChanged(IEnumerable<T> selectedItems)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | selectedItems |
Returns
Type | Description |
---|---|
Task |
OnTrackedItemChanged(object, string)
Provids a mechanism for handling changes for any item in the context
By default this is used to apply changes made to a selected item automatically to all other selected items in the grid (if multi-select is enabled)
Declaration
protected override void OnTrackedItemChanged(object item, string propName)
Parameters
Type | Name | Description |
---|---|---|
object | item | The item that changed |
string | propName | The property name of the changed value |
Overrides
PivotColumns(short)
A list of all the columns to be added to the grid that are pivot columns coming from another entity type
Used by the BaseGridControllerWrapper<TWrapper, TMain, TPivot>
Declaration
protected virtual IEnumerable<ControlDisplayInfo> PivotColumns(short index)
Parameters
Type | Name | Description |
---|---|---|
short | index | The current total of the indexes of the columns added to the grid so far |
Returns
Type | Description |
---|---|
IEnumerable<ControlDisplayInfo> | A list of all the columns to be added to the grid that are pivot columns coming from another entity type |
ReApply()
Declaration
public void ReApply()
Redisplay()
Gets the query for all the results for this grid again, reloads all the results taking account of all sorting, filters, searches, and paging, and updates the results in the IBaseGrid<T>
Declaration
public override Task Redisplay()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
Overrides
RemoveItems(IEnumerable<T>)
Removes the specified set of items from the grid and if the items in the grid have a property marked as SequenceStart then it will decrement the ones above these deleted items to reflect their change in order
Declaration
public virtual Task RemoveItems(IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | items | The items to be removed from the CurrentItems |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
ResetColumnsAndGroups(bool)
Clears all the columns and groups from the grid, and reinitializes it
If redisplay
is true then will automatically Redisplay() the view too
Declaration
public Task ResetColumnsAndGroups(bool redisplay)
Parameters
Type | Name | Description |
---|---|---|
bool | redisplay | Indicates that after clearing the grid, and its columns/groups, it should rebuild the grid and redisplay the data |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
SetPageIndex(int)
Sets the current page index that should be viewed in the grid to the specified index
. Then
Redisplay()s the grid to show the results of that page in the grid
Declaration
public Task SetPageIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the paged results that should be visible in the grid |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
SetTotalCount(int)
Sets the total count of results from the query.
This may not be the total amount of rows seen in the grid if the DefaultRowCount is less than this amount
In which case the IBaseGrid<T> will be paging the results in the gridDeclaration
protected void SetTotalCount(int count)
Parameters
Type | Name | Description |
---|---|---|
int | count | The total number of results returned by the query that should populate the grid |
ToggleSearch(bool)
Declaration
public void ToggleSearch(bool visible)
Parameters
Type | Name | Description |
---|---|---|
bool | visible |
ToggleZeroColumns()
Switches between showing all number columns and only those that have non-zero values
Declaration
public override void ToggleZeroColumns()
Overrides
TrackResults(IEnumerable<T>)
Adds all the specified items to the TrackItem(INotifyPropertyChanged) for this IBaseGrid<T>
Declaration
public void TrackResults(IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | items | The items to make sure they are tracked by this displayer |
UpdateAllZeroColumns()
Forces update of columns marked as zero columns
Declaration
public void UpdateAllZeroColumns()
UpdateColumnFromName(string)
Forces the IBaseGrid<T> to update the column in the grid itself to reflect changes to the column definition
Finds the column to be updated from the provided propertyName
, calls
AlterColumnInfo(ControlDisplayInfo) with the column the updates the display in the grid
Declaration
protected void UpdateColumnFromName(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
string | propertyName | The property name of the column in the grid that should be updated |
UpdateNewItem(T)
Provides an inheriting controller an opportunity to alter the newly created item by the grid before it is added to the IBaseGrid<T> itself
By default this ensures the item has the next maximum sequence number if the item is an entity that has a property with a SequenceStart
Declaration
protected virtual Task UpdateNewItem(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The newly created item to be added to the grid |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
UpdateTransferColumnStatus()
Switches between showing the TransferID column for a transactional item with a transfer and hiding it
Declaration
public void UpdateTransferColumnStatus()