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 UIInheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Core
Assembly: ClientCore.dll
Syntax
public abstract class BaseGridControllerAny<T> : BaseGridController, IBaseGridController, IModelViewController, ICollectionExportable, INewGridItemImplementor<T>, ICopyGridItemImplementor<T>, IGrid, IDeleteGridItemImplementor<T>
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)
T
is an entity type deriving from IBaseEntity
Declaration
protected virtual bool AddStandardColumns { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
BulkUpdateMulltipleSelectedItemsOnEdit
Indicates whether or not the system should apply any changes made to all other selected items in the grid.
The system uses this to turn off the feature while updating, but can also be used to override the behaviour when needed
Declaration
public bool BulkUpdateMulltipleSelectedItemsOnEdit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 |
---|---|
System.Boolean |
CollectionType
Indicates the collection type is of type T
Declaration
public override Type CollectionType { get; }
Property Value
Type | Description |
---|---|
System.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 |
---|---|
System.Collections.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 |
---|---|
System.Collections.ObjectModel.ObservableCollection<T> |
CurrentPageIndex
The current page index of the results in the grid if PagerRequired is true
This is a 0 bound index, so the first page has an index of 0
Declaration
public int CurrentPageIndex { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
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 UIRestrictedMaxCollectionItems which can be set depending on the client application. For instance mobiles can override this to a smaller number
The default if UIRestrictedMaxCollectionItems is not set is 500Declaration
public virtual int DefaultRowCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
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 |
---|---|
System.Collections.Generic.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> |
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 |
---|---|
System.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 |
---|---|
System.Boolean |
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 |
---|---|
System.String |
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 |
---|---|
System.Boolean |
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 |
---|---|
System.Collections.Generic.IEnumerable<ControlDisplayInfo> |
SelectedItemForSubViews
Returns the first selected item in the IBaseGrid<T> for any sub-views
Declaration
public override object SelectedItemForSubViews { get; }
Property Value
Type | Description |
---|---|
System.Object |
Overrides
Sortings
The current sortings applied to the IBaseGrid<T>
Declaration
public IEnumerable<QueryableSort> Sortings { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.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 |
---|---|
System.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 |
---|---|
System.Int32 |
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 |
---|---|
System.Int32 |
TrackItemChanges
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 TrackItemChanges { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
TransferColToggler
The toggler for showing/hiding TransferID column for a transactional item
Declaration
public IHasToggleStatus TransferColToggler { get; set; }
Property Value
Type | Description |
---|---|
IHasToggleStatus |
Methods
AddCol(Int16, 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 |
---|---|---|
System.Int16 | 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 |
---|---|
System.Threading.Tasks.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 void AlterLoadedItems(IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | items | The items loaded for display into the GridView |
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 |
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 bool CanDelete(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item to check if it can be deleted |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|
System.Boolean | 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 |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
CloseController()
Closes the grid view
Declaration
public override Task CloseController()
Returns
Type | Description |
---|---|
System.Threading.Tasks.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 withDeclaration
protected virtual IEnumerable<ControlDisplayInfoLight> ColumnNames()
Returns
Type | Description |
---|---|
System.Collections.Generic.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 |
---|---|
System.Collections.Generic.IEnumerable<ControlDisplayInfo> | A list of all the columns to be created against the IBaseGrid<T> by this control |
Overrides
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 |
---|---|
System.Threading.Tasks.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 |
---|---|---|
System.Collections.Generic.IEnumerable<ColumnDescriptor> | visibleColumns | The currently visible columns in the grid |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.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 |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<T>> | A list of items to be displayed against the grid given all active filters, sorting, searches, paging, etc |
GetGridSourceItems(IEnumerable<T>)
Returns the currentItems
with the AlterQuery(QueryableExecuter<T>) filtering applied to the results
Declaration
public virtual IEnumerable<T> GetGridSourceItems(IEnumerable<T> currentItems)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | currentItems | The current items to be displayed in the grid |
Returns
Type | Description |
---|---|
System.Collections.Generic.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 |
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 |
---|---|---|
System.Func<IBaseEntity, System.Threading.Tasks.Task> | callBack | A callback to be invoked for each antity selected by the user for the new item(s) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.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)
Declaration
protected IEnumerable<ControlDisplayInfoLight> GetStandardExtraColumns(string uniqueGroupKey = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | uniqueGroupKey |
Returns
Type | Description |
---|---|
System.Collections.Generic.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 |
---|---|---|
System.Collections.Generic.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 |
---|---|
System.Threading.Tasks.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 |
---|---|---|
System.String | colName | The name of the column to check if any of the numbers displayed in it are non-zero |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
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 |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
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 |
---|---|---|
System.Object | item | The item that changed |
System.String | propName | The property name of the changed value |
Overrides
PivotColumns(Int16)
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 |
---|---|---|
System.Int16 | index | The current total of the indexes of the columns added to the grid so far |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ControlDisplayInfo> | A list of all the columns to be added to the grid that are pivot columns coming from another entity type |
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 |
---|---|
System.Threading.Tasks.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 |
---|---|---|
System.Collections.Generic.IEnumerable<T> | items | The items to be removed from the CurrentItems |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
ResetColumnsAndGroups(Boolean)
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 |
---|---|---|
System.Boolean | redisplay | Indicates that after clearing the grid, and its columns/groups, it should rebuild the grid and redisplay the data |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
SetPageIndex(Int32)
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 |
---|---|---|
System.Int32 | index | The index of the paged results that should be visible in the grid |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
SetTotalCount(Int32)
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 |
---|---|---|
System.Int32 | count | The total number of results returned by the query that should populate the grid |
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 |
---|---|---|
System.Collections.Generic.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 |
---|---|---|
System.String | propertyName | The property name of the column in the grid that should be updated |
UpdateNewItem(T)
Provudes 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 |
---|---|
System.Threading.Tasks.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()
Explicit Interface Implementations
IDeleteGridItemImplementor<T>.Grid
Returns the GridView itself as the implementation of the IGridSelector
Declaration
IGridSelector IDeleteGridItemImplementor<T>.Grid { get; }
Returns
Type | Description |
---|---|
IGridSelector |