Selection in TypeScript Treegrid control

Selection provides an option to highlight a row or a cell. It can be done through simple mouse down or arrow keys. To disable selection in TreeGrid, set the allowSelection to false.

The treegrid supports two types of selection that can be set by using the selectionSettings.type. They are:

  • Single: The Single value is set by default, and it only allows selection of a single row or a cell.
  • Multiple: Allows you to select multiple rows or cells.
    To perform the multi-selection, press and hold CTRL key and click the desired rows or cells. To select range of rows or cells, press and hold the SHIFT key and click the rows or cells.

Selection mode

TreeGrid supports three types of selection mode which can be set by using
selectionSettings.mode. They are:

  • Row - The row value is set by default. Allows you to select rows only.
  • Cell - Allows you to select cells only.
  • Both - Allows you to select rows and cells at the same time.

Touch interaction

When you tap a treegrid row on touchscreen device, the tapped row is selected.
It also shows a popup Multi Row selection for multi-row selection.
To select multiple rows or cells, tap the popup Multi Row or Cells and then tap the desired rows or cells.

Multi-selection requires the selection type to be multiple.

The following screenshot represents a treegrid touch selection in the device.

Touch interaction

You can refer to our JavaScript Tree Grid feature tour page for its groundbreaking feature representations. You can also explore our JavaScript Tree Grid example JavaScript Tree Grid example to knows how to present and manipulate data.