Search Results for

    Show / Hide Table of Contents

    Class BaseGridControllerWrapper<TWrapper, TMain, TPivot>

    The base wrapper grid controller which works with the IBaseGridWrapperCollection<TWrapper, TMain, TPivot> view displaying wrapped items with pivotted columns in the wrapper

    This is the main controller for creating grids of any wrapped item in the system that holds pivotted columns of another item in the system

    Both this controller and the BaseDefaultSingleViewController<T> view have a similar mechanism for creating controls dynamically within the UI
    Inheritance
    System.Object
    ModelViewController
    BaseGridController
    BaseGridControllerAny<TWrapper>
    BaseGridControllerWrapper<TWrapper, TMain, TPivot>
    Implements
    IBaseGridController
    IModelViewController
    ICollectionExportable
    INewGridItemImplementor<TWrapper>
    ICopyGridItemImplementor<TWrapper>
    IGrid
    IDeleteGridItemImplementor<TWrapper>
    Inherited Members
    BaseGridControllerAny<TWrapper>.GetGridController(IBaseGrid<TWrapper>)
    BaseGridControllerAny<TWrapper>.CollectionType
    BaseGridControllerAny<TWrapper>.Descriptor
    BaseGridControllerAny<TWrapper>.CanEditRowItem(TWrapper)
    BaseGridControllerAny<TWrapper>.TrackItemChanges
    BaseGridControllerAny<TWrapper>.OnTrackedItemChanged(Object, String)
    BaseGridControllerAny<TWrapper>.RowPreviewColumns
    BaseGridControllerAny<TWrapper>.BulkUpdateMulltipleSelectedItemsOnEdit
    BaseGridControllerAny<TWrapper>.GridView
    BaseGridControllerAny<TWrapper>.GetGridSourceItems(IEnumerable<TWrapper>)
    BaseGridControllerAny<TWrapper>.AlterLoadedItems(IEnumerable<TWrapper>)
    BaseGridControllerAny<TWrapper>.Clear()
    BaseGridControllerAny<TWrapper>.CloseController()
    BaseGridControllerAny<TWrapper>.CurrentGridItems
    BaseGridControllerAny<TWrapper>.CurrentItems
    BaseGridControllerAny<TWrapper>.InitDisplay()
    BaseGridControllerAny<TWrapper>.ResetColumnsAndGroups(Boolean)
    BaseGridControllerAny<TWrapper>.DisplayUI()
    BaseGridControllerAny<TWrapper>.AutoSelectFirstRow
    BaseGridControllerAny<TWrapper>.Columns()
    BaseGridControllerAny<TWrapper>.AddCol(Int16, ControlDisplayInfoLight, EntityDescriptor)
    BaseGridControllerAny<TWrapper>.ColumnNames()
    BaseGridControllerAny<TWrapper>.AddStandardColumns
    BaseGridControllerAny<TWrapper>.StandardColumnsUniqueGroupKey
    BaseGridControllerAny<TWrapper>.SelectedItemForSubViews
    BaseGridControllerAny<TWrapper>.UpdateNewItem(TWrapper)
    BaseGridControllerAny<TWrapper>.AlterQuery(QueryableExecuter<TWrapper>)
    BaseGridControllerAny<TWrapper>.ApplyGridSettingsToFilter(QueryableExecuter)
    BaseGridControllerAny<TWrapper>.ApplyPaging(QueryableExecuter)
    BaseGridControllerAny<TWrapper>.SetTotalCount(Int32)
    BaseGridControllerAny<TWrapper>.PagerRequired
    BaseGridControllerAny<TWrapper>.CurrentPageIndex
    BaseGridControllerAny<TWrapper>.TotalCount
    BaseGridControllerAny<TWrapper>.TotalPageCount
    BaseGridControllerAny<TWrapper>.Sortings
    BaseGridControllerAny<TWrapper>.Filters
    BaseGridControllerAny<TWrapper>.SetPageIndex(Int32)
    BaseGridControllerAny<TWrapper>.Redisplay()
    BaseGridControllerAny<TWrapper>.TrackResults(IEnumerable<TWrapper>)
    BaseGridControllerAny<TWrapper>.AlterColumnInfo(ControlDisplayInfo)
    BaseGridControllerAny<TWrapper>.UpdateColumnFromName(String)
    BaseGridControllerAny<TWrapper>.GetExportableColumnInfo(IEnumerable<ColumnDescriptor>)
    BaseGridControllerAny<TWrapper>.TogglerZeroColumn
    BaseGridControllerAny<TWrapper>.IsZeroColumnColumnVisible(String)
    BaseGridControllerAny<TWrapper>.ToggleZeroColumns()
    BaseGridControllerAny<TWrapper>.UpdateAllZeroColumns()
    BaseGridControllerAny<TWrapper>.UpdateTransferColumnStatus()
    BaseGridControllerAny<TWrapper>.TransferColToggler
    BaseGridControllerAny<TWrapper>.CanDelete(TWrapper)
    BaseGridControllerAny<TWrapper>.CanCreateNew
    BaseGridControllerAny<TWrapper>.GetStandardExtraColumns(String)
    BaseGridControllerAny<TWrapper>.IDeleteGridItemImplementor<TWrapper>.Grid
    BaseGridControllerAny<TWrapper>.InitCommands(IList<ViewCommand>)
    BaseGridControllerAny<TWrapper>.ExcelExportCommand
    BaseGridControllerAny<TWrapper>.NewItemHelper
    BaseGridControllerAny<TWrapper>.CopyItemHelper
    BaseGridControllerAny<TWrapper>.GetPublicToggleCommand()
    BaseGridControllerAny<TWrapper>.GetOpenGridCommand()
    BaseGridControllerAny<TWrapper>.GetNewGridCommand()
    BaseGridControllerAny<TWrapper>.GetCopyGridCommand()
    BaseGridControllerAny<TWrapper>.GetDeleteCommand()
    BaseGridControllerAny<TWrapper>.GetUpCommand()
    BaseGridControllerAny<TWrapper>.GetDownCommand()
    BaseGridControllerAny<TWrapper>.AllowColumnSelection
    BaseGridControllerAny<TWrapper>.AllowPublicToggleCommand
    BaseGridControllerAny<TWrapper>.AllowSearchCommand
    BaseGridControllerAny<TWrapper>.AllowOpenCommand
    BaseGridControllerAny<TWrapper>.AllowDeleteCommand
    BaseGridControllerAny<TWrapper>.AllowNewCommand
    BaseGridControllerAny<TWrapper>.AllowCopyCommand
    BaseGridControllerAny<TWrapper>.AllowXMLImportExport
    BaseGridControllerAny<TWrapper>.AllowMultipleSelect
    BaseGridControllerAny<TWrapper>.AllowExcelExport
    BaseGridControllerAny<TWrapper>.AllowSequencing
    BaseGridControllerAny<TWrapper>.AutoOpenNewItemInTab
    BaseGridControllerAny<TWrapper>.OpenFromRelatedColumnName
    BaseGridControllerAny<TWrapper>.OnOpenRowItem(TWrapper)
    BaseGridControllerAny<TWrapper>.PopulateNewFromLookupColumnName
    BaseGridControllerAny<TWrapper>.GetLookupIDsForNewItems(Func<IBaseEntity, Task>)
    BaseGridControllerAny<TWrapper>.PreventDuplicateLookupIDs
    BaseGridControllerAny<TWrapper>.RemoveItems(IEnumerable<TWrapper>)
    BaseGridControllerAny<TWrapper>.AddItem(TWrapper)
    BaseGridController.ComboItemsClear
    BaseGridController.ColumnGroups()
    BaseGridController.DefaultColumnGroupIndexes
    BaseGridController.DefaultFrozenColumnCount
    BaseGridController.AllPossibleSearchColumns()
    BaseGridController.InternalFilter
    BaseGridController.ColumnSortings
    BaseGridController.ColumnFilters
    BaseGridController.SearchColumns
    BaseGridController.Search
    BaseGridController.SetOrdering(IEnumerable<QueryableSort>)
    BaseGridController.SetFilters(IEnumerable<QueryableFilter>)
    BaseGridController.SetSearch(String, IEnumerable<String>)
    BaseGridController.DefaultSearchColumn
    BaseGridController.BaseGridView
    BaseGridController.GetVisibleColumnNames()
    BaseGridController.OnlyExportGrid
    BaseGridController.OnlyExportFromQuery
    BaseGridController.Created
    BaseGridController.IGrid.GridItems
    ModelViewController.CurrentDisplayedItem
    ModelViewController.CanWrite
    ModelViewController.CheckIsLockedForCanWrite
    ModelViewController.View
    ModelViewController.InitAsync()
    ModelViewController.DisplayItem(Object)
    ModelViewController.ShouldDisplayItem(Object)
    ModelViewController.DisplayIfNull
    ModelViewController.RemoveHandlers(Object)
    ModelViewController.AddHandlers(Object)
    ModelViewController.RemoveCommand(ViewCommand)
    ModelViewController.RemoveCommands<OFType>()
    ModelViewController.InsertCommand(ViewCommand, Int32)
    ModelViewController.InsertCommand(ViewCommand, ViewCommand, ViewCommand)
    ModelViewController.Commands
    ModelViewController.UpdateAllCommands()
    ModelViewController.ContextHelpURL
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.Client.Core.Views.Core
    Assembly: ClientCore.dll
    Syntax
    public abstract class BaseGridControllerWrapper<TWrapper, TMain, TPivot> : BaseGridControllerAny<TWrapper>, IBaseGridController, IModelViewController, ICollectionExportable, INewGridItemImplementor<TWrapper>, ICopyGridItemImplementor<TWrapper>, IGrid, IDeleteGridItemImplementor<TWrapper> where TWrapper : class, IWrapper, new()
        where TMain : IBaseEntity where TPivot : IBaseEntity
    Type Parameters
    Name Description
    TWrapper

    The type that wraps the main and pivotted classes. Must implement all the properties of TMain and have a indexed property for the pivotted ones of TPivot. This is the entity that is displayed in the grid

    TMain

    The main item that is displayed in the grid via the TWrapper with additional pivotted columns of another type

    TPivot

    The type of entity that holds additional properties to be pivotted on the wrapper

    Constructors

    BaseGridControllerWrapper(IBaseGridWrapperCollection<TWrapper, TMain, TPivot>)

    Creates a new base grid wrapper view controller with the specified instance of a default wrapper grid view

    Declaration
    public BaseGridControllerWrapper(IBaseGridWrapperCollection<TWrapper, TMain, TPivot> view)
    Parameters
    Type Name Description
    IBaseGridWrapperCollection<TWrapper, TMain, TPivot> view

    The instance of the default wrapper grid view in the client application

    Properties

    AllowIDFilter

    If true indicates that the TMain results of this grid can be altered by parameters of type DisplayableItemDescriptorForCollectionParams against the ItemParams

    The default is true, but is overridden for grids that display sub sets of information related to other items

    Declaration
    protected virtual bool AllowIDFilter { get; }
    Property Value
    Type Description
    System.Boolean

    DefaultRowCount

    If PivotQueryDependsOnMain is true then alters the default row count to 100 if it is less than the base default row count

    Default is lowered as the query to load pivot information can be quite costly if it depends on the main results, and is better with less total rows.

    Declaration
    public override int DefaultRowCount { get; }
    Property Value
    Type Description
    System.Int32
    Overrides
    LemonEdge.Client.Core.Views.Core.BaseGridControllerAny<TWrapper>.DefaultRowCount

    Headers

    All the columns loaded to hold the extra properties on the TWrapper type

    Declaration
    protected IEnumerable<IBaseEntity> Headers { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<IBaseEntity>

    PivotColumnInfo

    The details of the indexed property on the TWrapper type that holds all the values for the pivotted properties

    This is used for every pivotted column created just with a different index for the different items from LoadPivotColumnHeaders()

    Declaration
    protected abstract (string Name, string GeneralDescription, ColumnType ColType, Type Type) PivotColumnInfo { get; }
    Property Value
    Type Description
    System.ValueTuple<System.String, System.String, ColumnType, System.Type>

    PivotQueryDependsOnMain

    Indicates the pivot query depends on the main results, often filtering the pivot results by the main results

    The default is true, but can be overridden for better performance

    Declaration
    protected virtual bool PivotQueryDependsOnMain { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    AlterMainQuery(QueryableExecuter<TMain>)

    Provides the inheriting controller an opportunity to modify the query used to load the data for these TMain items

    Default implementation does nothing unless the type TMain is an entity with a property with a SequenceStart, in which case it is ordered by that

    Declaration
    protected virtual QueryableExecuter<TMain> AlterMainQuery(QueryableExecuter<TMain> query)
    Parameters
    Type Name Description
    QueryableExecuter<TMain> query

    The query for this grid to always be altered before being executed

    Returns
    Type Description
    QueryableExecuter<TMain>

    The query to be used to execute results for this grid

    AlterPivotQuery(QueryableExecuter<TPivot>, IEnumerable<TMain>)

    Provides the inheriting controller an opportunity to modify the query used to load the data for these TPivot items

    Default implementation does nothing unless the type TPivot is an entity with a property with a SequenceStart, in which case it is ordered by that

    Declaration
    protected virtual QueryableExecuter<TPivot> AlterPivotQuery(QueryableExecuter<TPivot> query, IEnumerable<TMain> mainItems)
    Parameters
    Type Name Description
    QueryableExecuter<TPivot> query

    The query for this grid to always be altered before being executed

    System.Collections.Generic.IEnumerable<TMain> mainItems
    Returns
    Type Description
    QueryableExecuter<TPivot>

    The query to be used to execute results for this grid

    GetGridController(IBaseGridWrapperCollection<TWrapper, TMain, TPivot>)

    Creates the new default wrapper grid view controller with the specified instance of a default wrapper grid view

    Declaration
    public static BaseGridControllerWrapper<TWrapper, TMain, TPivot> GetGridController(IBaseGridWrapperCollection<TWrapper, TMain, TPivot> view)
    Parameters
    Type Name Description
    IBaseGridWrapperCollection<TWrapper, TMain, TPivot> view

    The instance of the default wrapper grid view in the client application

    Returns
    Type Description
    BaseGridControllerWrapper<TWrapper, TMain, TPivot>

    A new default wrapper grid view controller with the specified instance of a default wrapper grid view

    GetGridSourceItems()

    Loads the source items (TMain) along with all the associated pivot information for those items (TPivot) and then returns the created TWrapper for displaying all that

    Declaration
    public override Task<IEnumerable<TWrapper>> GetGridSourceItems()
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<TWrapper>>

    The combined loaded data of the TMain and TPivot in a wrapped TWrapper list

    Overrides
    LemonEdge.Client.Core.Views.Core.BaseGridControllerAny<TWrapper>.GetGridSourceItems()

    GetInternalDescriptor()

    Returns the entity descriptor for the type TMain

    Declaration
    protected override EntityDescriptor GetInternalDescriptor()
    Returns
    Type Description
    EntityDescriptor

    The entity descriptor for the type TMain

    Overrides
    LemonEdge.Client.Core.Views.Core.BaseGridControllerAny<TWrapper>.GetInternalDescriptor()

    GetMainCreationQuery()

    Returns the main intial query to return all entities of type TMain

    Includes any filtering requested from parameters of type DisplayableItemDescriptorForCollectionParams against the ItemParams if AllowIDFilter is true

    Also applies any paging required
    Declaration
    protected virtual QueryableExecuter<TMain> GetMainCreationQuery()
    Returns
    Type Description
    QueryableExecuter<TMain>

    The main intial query to return all entities of type TMain

    GetMainCurrentQuery()

    Returns the GetMainCreationQuery() for this entity type, with the AlterMainQuery(QueryableExecuter<TMain>) and ApplyGridSettingsToFilter(QueryableExecuter) applied

    Declaration
    public QueryableExecuter<TMain> GetMainCurrentQuery()
    Returns
    Type Description
    QueryableExecuter<TMain>

    The GetMainCreationQuery() for this entity type, with the AlterMainQuery(QueryableExecuter<TMain>) and ApplyGridSettingsToFilter(QueryableExecuter) applied

    GetPivotCreationQuery(IEnumerable<TMain>)

    Returns the main intial query to return all entities of type TPivot

    The default implementation filters the TPivot items returned by those referencing the specified mainItems. Requires PivotQueryDependsOnMain to be true.

    Also applies any paging required
    Declaration
    protected virtual QueryableExecuter<TPivot> GetPivotCreationQuery(IEnumerable<TMain> mainItems)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TMain> mainItems
    Returns
    Type Description
    QueryableExecuter<TPivot>

    The pivot intial query to return all entities of type TPivot

    GetPivotCurrentQuery(IEnumerable<TMain>)

    Returns the GetPivotCreationQuery(IEnumerable<TMain>) for this entity type, with the AlterPivotQuery(QueryableExecuter<TPivot>, IEnumerable<TMain>)

    Declaration
    public QueryableExecuter<TPivot> GetPivotCurrentQuery(IEnumerable<TMain> mainItems)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TMain> mainItems
    Returns
    Type Description
    QueryableExecuter<TPivot>

    The GetPivotCreationQuery(IEnumerable<TMain>) for this entity type, with the AlterPivotQuery(QueryableExecuter<TPivot>, IEnumerable<TMain>)

    GetQueryForExcelResults()

    The query for the results to export from this grid is the same as those to display the items -> GetMainCurrentQuery()

    This is achieved if the TMain has the appropriate EntityHasPivotAttribute associated with it

    Declaration
    public override QueryableExecuter GetQueryForExcelResults()
    Returns
    Type Description
    QueryableExecuter

    The query for the results to export from this grid is the same as those to display the items -> GetMainCurrentQuery()

    Overrides
    BaseGridController.GetQueryForExcelResults()

    LoadAdditionalColumns()

    Loads the columns required for the pivot properties on the wrapper

    Declaration
    protected override Task LoadAdditionalColumns()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A task indicating the completion of the operation

    Overrides
    LemonEdge.Client.Core.Views.Core.BaseGridControllerAny<TWrapper>.LoadAdditionalColumns()

    LoadPivotColumnHeaders()

    Loads the list of entities that should be the headers of the pivot columns for each extra column in the grid represented as an indexed property on TWrapper

    Declaration
    protected abstract Task<IEnumerable<IBaseEntity>> LoadPivotColumnHeaders()
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IBaseEntity>>

    The list of entities that should be the headers of the pivot columns for each extra column in the grid represented as an indexed property on TWrapper

    PivotColumns(Int16)

    Loads all the pivot columns to be added to the columns displayed against the IBaseGridWrapperCollection<TWrapper, TMain, TPivot>

    Declaration
    protected override IEnumerable<ControlDisplayInfo> PivotColumns(short index)
    Parameters
    Type Name Description
    System.Int16 index

    The index of all the columns added to the grid so far

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<ControlDisplayInfo>

    All the pivot columns to be added to the columns displayed against the IBaseGridWrapperCollection<TWrapper, TMain, TPivot>

    Overrides
    LemonEdge.Client.Core.Views.Core.BaseGridControllerAny<TWrapper>.PivotColumns(System.Int16)

    Implements

    IBaseGridController
    IModelViewController
    ICollectionExportable
    INewGridItemImplementor<T>
    ICopyGridItemImplementor<T>
    IGrid
    IDeleteGridItemImplementor<T>

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToCSVFormatString(Object, Type)
    SQLExtensions.ToSQLValue(Object, Boolean)
    In This Article
    Back to top © LemonTree Software Ltd. All rights reserved.