Bag Hexagon Iron Box Black Bag Clutch Hand Irregular Party Evening Evening Mini Geometric Personality Holding TuTu UAqnfwFA Bag Hexagon Iron Box Black Bag Clutch Hand Irregular Party Evening Evening Mini Geometric Personality Holding TuTu UAqnfwFA
Pull down to refresh...
Release to refresh...
Refreshing...
Loading...

Bag Hexagon Iron Box Black Bag Clutch Hand Irregular Party Evening Evening Mini Geometric Personality Holding TuTu UAqnfwFA

An array of grid columns.

Default Value: undefined

By default, a column is created for each field of a data source object, but in most cases, it is redundant. To specify a set of columns to be created in a grid, assign an array specifying these columns to the columns option. Each grid column is represented in this array by an object containing column settings or by a data source field that this column is bound to. Detailed information on specifying grid columns is given in the Columns Overview article.

Column options define the behavior and appearance of a grid column. One of the other capabilities allows you to control the sorting of column values using the allowSorting and sortOrder options, apply a filter to grid records using the allowFiltering and filterOperations options, and group grid records using the allowGrouping and groupIndex options. In addition, you can change the visibility and width of a column using corresponding options.

To get or set an option or several options for a column at runtime, use the columnOption method with the required arguments.

View Demo Watch Video

See Also

alignment

Aligns the content of the column.

Type:

String

Default Value: undefined
Accepted Values: undefined | 'center' | 'left' | 'right'

The default alignment of the content depends on the type of data.

dataType alignment
'number' 'right'
'boolean' 'center'
'string' 'left'
'date' 'left'
'datetime' 'left'

Use the HorizontalAlignment enum to specify this option when the widget is used as an ASP.NET MVC Control. This enum accepts the following values: Left, Center, and Right.

allowEditing

Specifies whether a user can edit values in the column at runtime. By default, inherits the value of the editing.allowUpdating option.

Type:

Boolean

Default Value: true
NOTE
If values in the column are calculated customarily using the calculateCellValue option, they cannot be edited at runtime.
See Also

allowExporting

Specifies whether data from this column should be exported.

Type:

Boolean

Default Value: true
See Also

allowFiltering

Specifies whether data can be filtered by this column. Applies only if filterRow.visible is true.

Type:

Boolean

Default Value: true
See Also

allowFixing

Specifies whether a user can fix the column at runtime. Applies only if columnFixing.enabled is true.

Type:

Boolean

Default Value: true
See Also

allowGrouping

Specifies whether the user can group data by values of this column. Applies only when grouping is enabled.

Type:

Boolean

Default Value: true

When grouping is enabled in the widget, the user can group data by values of any column. To prohibit a particular column from being used for grouping, set the allowGrouping option of this column to false.

NOTE
In a column with calculated values, this option is set to false by default.
See Also

allowHeaderFiltering

Specifies whether the header filter can be used to filter data by this column. Applies only if headerFilter.visible is true. By default, inherits the value of the allowFiltering option.

Type:

Boolean

Default Value: true

allowHiding

Specifies whether a user can hide the column using the column chooser at runtime. Applies only if columnChooser.enabled is true.

Type:

Boolean

Default Value: true
See Also

allowReordering

Specifies whether this column can be used in column reordering at runtime. Applies only if allowColumnReordering is true.

Type:

Boolean

Default Value: true

allowSearch

Specifies whether this column can be searched. Applies only if searchPanel.visible is true. Inherits the value of the allowFiltering option by default.

Type:

Boolean

Default Value: true

Shorts Straight Baggy Length Harem Solid Strandhosen Men's Clearance Work Slim Fashion Loose Gray Waist Summer Mid Sunday77 Short Pants Shorts Casual Beach Full Rwqnf4A

allowSorting

Specifies whether a user can sort rows by this column at runtime. Applies only if sorting.mode differs from "none".

Type:

Boolean

Default Value: true
NOTE
In a column with calculated values, this option is set to false by default.
See Also

autoExpandGroup

Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column.

Type:

Boolean

Default Value: true

calculateCellValue

Calculates custom values for column cells.

Type:

Function

Function parameters:

The data of the row to which the cell belongs.

Return Value: any

A cell's custom value.

Column cells contain values from the data field by default, but you can populate them with custom values instead. For this, declare the calculateCellValue function that is called each time a new row is rendered.

Certain features are disabled in a column with calculated values by default. The following list specifies these features and how you can enable them:

Feature Action that enables it
Editing Implement the setCellValue function.
Sorting Set the allowSorting option to true.
Grouping Set the allowGrouping option to true.
Filtering Set the allowFiltering option to true.
Searching Set the allowSearch option to true.
NOTE

Call the this.defaultCalculateCellValue(rowData) function and return its result to invoke the default behavior.

jQuery
Angular
TypeScript
HTML
             
  • import { DxDataGridModule } from 'devextreme-angular';
  • // ...
  • export class AppComponent {
  • calculateCellValue (rowData) {
  • // ...
  • let column = this as any;
  • return column.defaultCalculateCellValue(rowData);
  •  
  • }
  • }
  • @NgModule({
  • imports: Hexagon Personality TuTu Evening Box Bag Bag Clutch Evening Holding Black Geometric Mini Hand Irregular Party Iron [
  • // ...
  • DxDataGridModule
  • ],
  • // ...
  • })
             
  • ... >
  • [calculateCellValue]="calculateCellValue" ... >
NOTE
The this keyword refers to the column's configuration.
See Also

calculateDisplayValue

Calculates custom display values for column cells. Used when display values should differ from values for editing.

Type:

String

|

Function

Function parameters:

The data of the row to which the cell belongs.

Return Value: any

The value for the cell to display.

This option accepts the name of the data source field that provides display values...

jQuery
Angular
HTML
TypeScript
           
  • ... >
  • dataField="countryID"
  • calculateDisplayValue="country">
           
  • import { DxDataGridModule } from 'devextreme-angular';
  • // ...
  • export class AppComponent {
  • // ...
  • }
  • @NgModule({
  • imports: TuTu Hand Bag Holding Clutch Geometric Bag Personality Box Mini Evening Party Black Irregular Hexagon Evening Iron [
  • // ...
  • DxDataGridModule
  • ],
  • // ...
  • })
ASP.NET MVC Controls
Razor C#
Razor VB
           
  • @(Html.DevExtreme().DataGrid()
  • .Columns(columns => columns.Add()
  • .DataField("CountryID")
  • .CalculateDisplayValue("Country")
  • )
  • )
           
  • @(Html.DevExtreme().DataGrid() _
  • .Columns(Sub(columns)
  • columns.Add() _
  • .DataField("CountryID") _
  • .CalculateDisplayValue("Country")
  • End Sub)
  • )

... or a function that combines display values.

jQuery
Angular
HTML
TypeScript
           
           
  • import { DxDataGridModule } from 'devextreme-angular';
  • // ...
  • export class AppComponent {
  • getCountryWithCapital(rowData) {
  • return rowData.capital + " (" + rowData.country + ")";
  • }
  • }
  • @NgModule({
  • imports: [
  • // ...
  • DxDataGridModule
  • ],
  • // ...
  • })
ASP.NET MVC Controls
Razor C#
Razor VB
           
  • @(Html.DevExtreme().DataGrid()
  • .Columns(columns => columns.Add()
  • .DataField("CountryID")
  • .CalculateDisplayValue(new JS("getCountryWithCapital"))
  • )
  • )
  •