Search Results for

    Show / Hide Table of Contents

    Class BaseGridController

    The base non-type generic version of BaseGridControllerAny<T>/BaseGridController<T> which works with the IBaseGrid<T> view

    This is the main base controller for creating grids, and dynamically creating their columns, for any object in the system

    Both this controller and the BaseDefaultSingleViewController<T> view have a similar mechanism for creating controls dynamically within the UI
    Inheritance
    object
    ModelViewController
    BaseGridController
    BaseGridControllerAny<T>
    Implements
    IBaseGridController
    IGrid
    IModelViewController
    ICollectionExportable
    Inherited Members
    ModelViewController.DisplayItem(object)
    ModelViewController.GetCurrentDisplayedItem(object)
    ModelViewController.Redisplay()
    ModelViewController.Clear()
    ModelViewController.CloseController()
    ModelViewController.OnTrackedItemChanged(object, string)
    ModelViewController.GetCanWrite(object)
    ModelViewController.ShouldDisplayItem(object)
    ModelViewController.RemoveHandlers(object)
    ModelViewController.AddHandlers(object)
    ModelViewController.DisplayUI()
    ModelViewController.RemoveCommand(ViewCommand)
    ModelViewController.RemoveCommands<TOfType>()
    ModelViewController.InsertCommand(ViewCommand, int)
    ModelViewController.InsertCommand(ViewCommand, ViewCommand, ViewCommand)
    ModelViewController.UpdateAllCommands()
    ModelViewController.GetNestedViews()
    ModelViewController.RootController
    ModelViewController.ServiceContext
    ModelViewController.UIContext
    ModelViewController.CanWrite
    ModelViewController.ListenToChanges
    ModelViewController.TrackChanges
    ModelViewController.CheckIsLockedForCanWrite
    ModelViewController.DisplayIfNull
    ModelViewController.CurrentDisplayedItem
    ModelViewController.View
    ModelViewController.Commands
    ModelViewController.SelectedItemForSubViews
    ModelViewController.ContextHelpURL
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Client.Core.Views.Core
    Assembly: LemonEdge.ClientCore.dll
    Syntax
    public abstract class BaseGridController : ModelViewController, IBaseGridController, IGrid, IModelViewController, ICollectionExportable

    Constructors

    BaseGridController(IModelView)

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

    Declaration
    protected BaseGridController(IModelView view)
    Parameters
    Type Name Description
    IModelView view

    The instance of the default grid view in the client application

    Properties

    BaseGridView

    The IBaseGrid view instance this controller works with

    Declaration
    public IBaseGrid BaseGridView { get; }
    Property Value
    Type Description
    IBaseGrid

    BulkUpdateMultipleSelectedItemsOnEdit

    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 BulkUpdateMultipleSelectedItemsOnEdit { get; set; }
    Property Value
    Type Description
    bool

    CollectionType

    Returns the type of object displayed in the grid

    Declaration
    public abstract Type CollectionType { get; }
    Property Value
    Type Description
    Type

    ColumnFilters

    Provides a list of the current groupings applied to the grid in the view by the user

    Declaration
    public IEnumerable<QueryableFilter> ColumnFilters { get; }
    Property Value
    Type Description
    IEnumerable<QueryableFilter>

    ColumnSortings

    Provides a list of the current sortings applied to the grid in the view by the user

    Declaration
    public IEnumerable<QueryableSort> ColumnSortings { get; }
    Property Value
    Type Description
    IEnumerable<QueryableSort>

    ComboItemsClear

    Provides a header to add to drop down combo columns so users can clear the value.

    By default this is blank as client applications can implement it on right-click or other behaviour.

    Somme applications do not allow that, so naming this Clear, or other value, will mean it is available for users to select at the top of the list to clear the value
    Declaration
    public static string ComboItemsClear { get; set; }
    Property Value
    Type Description
    string

    Created

    Indicates the grid has been created within the BaseGridView

    Declaration
    public bool Created { get; }
    Property Value
    Type Description
    bool

    CurrentGridItems

    An enumeration of all the records currently displayed in the BaseGridView

    Declaration
    public abstract IEnumerable CurrentGridItems { get; }
    Property Value
    Type Description
    IEnumerable

    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
    int

    CustomCommandParam

    Declaration
    protected virtual string CustomCommandParam { get; }
    Property Value
    Type Description
    string

    DefaultColumnGroupIndexes

    Groupings for columns to be grouped by and items have aggregation summaries of

    Declaration
    public virtual IEnumerable<int> DefaultColumnGroupIndexes { get; }
    Property Value
    Type Description
    IEnumerable<int>

    DefaultFrozenColumnCount

    The default number of columns to be included in the frozen column count. The default is 1

    Declaration
    public virtual int DefaultFrozenColumnCount { get; }
    Property Value
    Type Description
    int

    DefaultSearchColumn

    The name of the column to use in the default search of text in the grid

    Declaration
    protected virtual string DefaultSearchColumn { get; }
    Property Value
    Type Description
    string

    ExpandDefaultGroups

    Indicates groups should be expanded by default - false by default

    Declaration
    public virtual bool ExpandDefaultGroups { get; }
    Property Value
    Type Description
    bool

    InternalFilter

    Provides the internal filter applied to the grid

    Declaration
    public QueryableFilter InternalFilter { get; set; }
    Property Value
    Type Description
    QueryableFilter

    IsSelected

    Indicates whether checkbox is checked or not in grid.

    Declaration
    public bool IsSelected { get; set; }
    Property Value
    Type Description
    bool

    LoadOrOverridenPager

    Declaration
    public bool LoadOrOverridenPager { get; }
    Property Value
    Type Description
    bool

    LoadPager

    Indicates if a pager should be used at all - default true. If not then all results will always be loaded

    Declaration
    public virtual bool LoadPager { get; }
    Property Value
    Type Description
    bool

    OnlyExportFromQuery

    Indicates when performing a stadard data export that the data should only be exported by re-running a query to fetch the results again

    The default is false

    Declaration
    public virtual bool OnlyExportFromQuery { get; }
    Property Value
    Type Description
    bool

    OnlyExportGrid

    Indicates when performing a stadard data export that the data should only be exported from the grid itself, and not re-run any query

    The default is false

    Declaration
    public virtual bool OnlyExportGrid { get; }
    Property Value
    Type Description
    bool

    PagerRequired

    Indicates if the BaseGridView needs to display a pager control as the number of results exceed the maximum the grid shows in one go

    Declaration
    public abstract bool PagerRequired { get; }
    Property Value
    Type Description
    bool

    Search

    The search term to be included in any query filtering the results for this grid

    Declaration
    public string Search { get; }
    Property Value
    Type Description
    string

    SearchColumns

    The list of all columns to be searched by default when doing a default text search of everything

    Declaration
    public IEnumerable<string> SearchColumns { get; }
    Property Value
    Type Description
    IEnumerable<string>

    TogglerZeroColumn

    Provides the toggler for switching between only showing columns with non-zero values or all

    Declaration
    public abstract IHasToggleStatus TogglerZeroColumn { get; }
    Property Value
    Type Description
    IHasToggleStatus

    UserOverridenPagingVisible

    Declaration
    public bool? UserOverridenPagingVisible { get; set; }
    Property Value
    Type Description
    bool?

    Methods

    AddCustomCommand(ICustomCommand)

    Declaration
    protected virtual bool AddCustomCommand(ICustomCommand cmd)
    Parameters
    Type Name Description
    ICustomCommand cmd
    Returns
    Type Description
    bool

    AllPossibleSearchColumns()

    Returns an enumeration of all column definitions that could be included in a default text search of the data in the grid

    Declaration
    public IEnumerable<string> AllPossibleSearchColumns()
    Returns
    Type Description
    IEnumerable<string>

    An enumeration of all column definitions that could be included in a default text search of the data in the grid

    ClearSearchSortFilter()

    Clears the search, sorting and filtering.

    Declaration
    public virtual Task ClearSearchSortFilter()
    Returns
    Type Description
    Task

    ColumnGroups()

    Header groupings that columns belong to. Can be hierarchical

    Declaration
    public virtual IEnumerable<GridColumnGroup> ColumnGroups()
    Returns
    Type Description
    IEnumerable<GridColumnGroup>

    Columns()

    A list of all the columns to be dynamically created in the IBaseGrid

    Can be overridden by the inheriting class to indicate the columns required.

    Declaration
    public virtual IEnumerable<ControlDisplayInfo> Columns()
    Returns
    Type Description
    IEnumerable<ControlDisplayInfo>

    A list of all the controls to be dynamically created in the BaseGridView

    GetExportableColumnInfo(IEnumerable<ColumnDescriptor>)

    Returns an enumeration of all the columns that can be exported from this grid in a standard data export (including which columns are currently visible or not)

    Declaration
    public abstract Task<IEnumerable<ControlDisplayVisibilityInfo>> GetExportableColumnInfo(IEnumerable<ColumnDescriptor> visibleColumns)
    Parameters
    Type Name Description
    IEnumerable<ColumnDescriptor> visibleColumns

    The list of currently visible columns in the BaseGridView

    Returns
    Type Description
    Task<IEnumerable<ControlDisplayVisibilityInfo>>

    An enumeration of all the columns that can be exported from this grid in a standard data export (including which columns are currently visible or not)

    GetQueryForExcelResults()

    Returns the query to use for retrieving the data in this grid for a standard data export

    Declaration
    public virtual QueryableExecuter GetQueryForExcelResults()
    Returns
    Type Description
    QueryableExecuter

    The query to use for retrieving the data in this grid for a standard data export

    GetVisibleColumnNames()

    Returns the currently visible columns in the BaseGridView

    Declaration
    public Task<IEnumerable<ControlDisplayInfo>> GetVisibleColumnNames()
    Returns
    Type Description
    Task<IEnumerable<ControlDisplayInfo>>

    The currently visible columns in the BaseGridView

    InitAsync()

    Provides the controller a chance to initialize any dependant data. Called once by the system after controller creation.

    Declaration
    public override Task InitAsync()
    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    Overrides
    ModelViewController.InitAsync()

    InitCommands(IList<ViewCommand>)

    Provides the inheriting class an opportunity to add custom commands to this controller

    Declaration
    protected override void InitCommands(IList<ViewCommand> commands)
    Parameters
    Type Name Description
    IList<ViewCommand> commands

    The current set of commands for this controller

    Overrides
    ModelViewController.InitCommands(IList<ViewCommand>)

    MoveItemSequence(object, object)

    Declaration
    public abstract void MoveItemSequence(object fromItem, object toItem)
    Parameters
    Type Name Description
    object fromItem
    object toItem

    ProcessCustomCommandResult(object)

    Declaration
    protected virtual Task ProcessCustomCommandResult(object result)
    Parameters
    Type Name Description
    object result
    Returns
    Type Description
    Task

    SetCreated(bool)

    Sets the grid as having been created

    Declaration
    protected void SetCreated(bool created)
    Parameters
    Type Name Description
    bool created

    Indicates if the grid has been created in the client ui yet

    SetFilters(IEnumerable<QueryableFilter>)

    Sets the ColumnFilters to the specified list of columns

    Declaration
    public void SetFilters(IEnumerable<QueryableFilter> filters)
    Parameters
    Type Name Description
    IEnumerable<QueryableFilter> filters

    The columns to be filtered and by how

    SetOrdering(IEnumerable<QueryableSort>)

    Sets the ColumnSortings to the specified list of columns

    Declaration
    public void SetOrdering(IEnumerable<QueryableSort> orders)
    Parameters
    Type Name Description
    IEnumerable<QueryableSort> orders

    The columns to be sorted and in which direction

    SetSearch(string, IEnumerable<string>)

    Sets the Search term to be used, and for which columns, when querying the results of the grid

    Declaration
    public void SetSearch(string search, IEnumerable<string> columns)
    Parameters
    Type Name Description
    string search

    The term to search for across the grid data

    IEnumerable<string> columns

    The columns included in the search

    ToggleZeroColumns()

    Toggles between only showing columns with non-zero values or all

    Declaration
    public abstract void ToggleZeroColumns()

    Implements

    IBaseGridController
    IGrid
    IModelViewController
    ICollectionExportable

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.