Angular DataGrid - selection

Configures runtime selection.

Type:

Object

A user can select rows in a single or multiple mode. In multiple mode, a user can select all rows at once. To disable this feature, assign false to the allowSelectAll.

By default, once a user selects a row, the data source is instantly notified about it. This may lower the UI component performance if the data source is remote and the user is allowed to select all rows at once. In this case, we recommend making the selection deferred.

View Demo

See Also

allowSelectAll

Specifies whether a user can select all rows at once.

Type:

Boolean

Default Value: true

If this property is set to true, it allows a user to select all rows at once by pressing Ctrl + A or clicking the check box in the selection column's header. The "Select All" check box also allows a user to deselect all rows. The select all functionality allows selecting/deselecting only those rows that meet filtering conditions if a filter is applied.

If this property is set to false, it disables the select all functionality. In this case, the check box clears selection and is hidden if no rows are selected.

deferred

Makes selection deferred.

Type:

Boolean

Default Value: false

Consider making selection deferred if the UI component needs to operate a large volume of data and the user is allowed to select all rows at once. Unlike usual (or "instant") selection, in the case of deferred selection, the UI component requests data only when you demand this using the API, for example, when the getSelectedRowsData() or getSelectedRowKeys() method is called. This mode has certain specifics that determine the API you need to use. For more information, see the Deferred Selection article.

NOTE
Deferred selection is unsupported when selectAllMode is "page".

View Demo

mode

Specifies the selection mode.

Type:

String

Default Value: 'none'
Accepted Values: 'multiple' | 'none' | 'single'

The following selection modes are available in the UI component:

  • Single
    Only one row can be in the selected state at a time.

  • Multiple
    Several rows can be in the selected state at a time.

Use the SelectionMode enum to specify this property when the UI component is used as an ASP.NET MVC 5 Control or a DevExtreme-Based ASP.NET Core Control. This enum accepts the following values: None, Single, and Multiple.

selectAllMode

Specifies the mode in which all the records are selected. Applies only if selection.allowSelectAll is true.

Type:

String

Default Value: 'allPages'
Accepted Values: 'allPages' | 'page'

selectAllMode specifies how records should be selected on clicking the "Select All" check box and by calling the selectAll()/deselectAll() methods. The following modes are available.

  • "page"
    Selects records on currently rendered pages.

    NOTE
    This mode is incompatible with deferred selection.
  • "allPages"
    Selects records on all pages.

Use the SelectAllMode enum to specify this property when the UI component is used as an ASP.NET MVC 5 Control or a DevExtreme-Based ASP.NET Core Control. This enum accepts the following values: Page and AllPages.

View Demo

See Also

showCheckBoxesMode

Specifies when to display the selection column and row selection checkboxes. Applies only if selection.mode is "multiple".

Type:

String

Default Value: 'onClick'
Accepted Values: 'always' | 'none' | 'onClick' | 'onLongTap'

The possible values are:

  • "onClick"
    The selection column is always shown. Checkboxes appear once a user clicks in the column or if two or more rows are selected programmatically or using keyboard shortcuts. Checkboxes disappear once row selection is canceled.

  • "onLongTap"
    The selection column with all the checkboxes appears and disappears on long tap (click and hold).

  • "always"
    The selection column with all the checkboxes is always visible. A user can select a row by clicking the checkbox or its grid cell, but not the row itself.

  • "none"
    The selection column with all the checkboxes is hidden. Users can select rows with keyboard shortcuts or long tap (click and hold).

Keyboard shortcuts work identically regardless of the chosen mode.

Use the GridSelectionShowCheckBoxesMode enum to specify this property when the UI component is used as an ASP.NET MVC 5 Control or a DevExtreme-Based ASP.NET Core Control. This enum accepts the following values: OnClick, OnLongTap, Always, and None.

View Demo

See Also