All docs
V20.1
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

GridContext Class

Provides a connection between data item containers from the Columns section and an underlying control's columns.

Declaration

export class GridContext

Remarks

The following code snippet shows how to use GridContext to get a Grid item's columns:

var Model = DevExpress.Dashboard.Model;

function onItemWidgetOptionsPrepared(args) {
    if(args.dashboardItem instanceof Model.GridItem) {
        var gridOptions = args.options;
        if(gridOptions.columns) {
            gridOptions.columns.forEach(function(columnOptions) {
                var dashboardColumn = args.gridContext.getDashboardItemColumn(columnOptions)
                if(dashboardColumn instanceof Model.GridDimensionColumn && dashboardColumn.dimension().dataMember() === "id") {
                    columnOptions.alignment = 'center';
                }
            })
        }
    }
}

constructor(_dashboardItem)

Initializes a new instance of the GridContext class with specified settings.

Declaration

constructor(_dashboardItem: GridItem)

Parameters

Name Type
_dashboardItem GridItem

Methods

getDashboardItemColumn(columnOptions) Method

Declaration

getDashboardItemColumn(columnOptions: DevExpress.ui.GridBaseColumn): GridColumn

Parameters

Name Type
columnOptions GridBaseColumn

Returns

Type
GridColumn