Search
Selecting, Scrolling and Sorting Programmatically

Selecting

Currently single cell selection and multiple row selection are supported in the grid control. You can select a cell programatically by using the selectCell method, and acces the selected
 cell(s) via the selectedCells property. Rows can be selected by using the selectRows method, and accessed via the selectedRowIndices property.

Cells, that belong to an editable column, can be focused programmatically (i.e. put in edit mode) by using the focusCell method and accessed via the focusedCell getter.

 Note

The focusCell method will scroll to the specified cell automatically, while selectCell/selectRows methods will not.

Scrolling

The scrollRow property lets you get or set the index of the first visible row. To ensure that a specified row in within the current viewport, but not set it as the first row, use the bringIntoView method.

Sorting

Sortable columns can be sorted programmatically by using the sortByColumn method, providing the column index and a boolean value indicating the sort order. Pass a null value for the column index to clear any existing sorting. The index of the sortedColumn can be accessed through the sortedColumn getter, and the sort order through the sortAscending getter.