Selection, keyboard and touch

The active cell

The grid has one active row, the dataset’s current record, and one active column (SelectedColumn); together they are the active cell, which is highlighted with the style’s selection colour (the whole row with egoRowSelect). The indicator gutter shows an arrow on the active row, an I-beam while it is being edited and a plus while it is a new row. Without egoAlwaysShowSelection the highlight shows only while the grid has the focus.

Keyboard

Key Action
Up / Down Previous / next row
PgUp / PgDn One page of rows up / down
Ctrl+Home / Ctrl+End First / last record
Left / Right Previous / next column
Home / End First / last column
Tab / Shift+Tab Next / previous cell, wrapping to the next / previous row (with egoTabs; without it, the next control of the form)
Enter Opens the editor; with TabOnEnter, next cell (Shift+Enter previous)
F2 Opens the editor
Space Toggles a check box cell
Esc Cancels the row being edited; otherwise clears the multi-selection
Ctrl+Tab Leaves the grid, to the next control of the form

See Editing for the keys inside an editor.

Mouse

A click makes a cell the active one (OnCellClick); a click on the active cell opens its editor. A click on an icon fires its own event instead. The right button fires OnCellRightClick or OnTitleRightClick without changing the active cell. The wheel scrolls the rows. Dragging a title moves its column and dragging a title’s edge resizes it (egoColumnMove, egoColumnResize); a click on a title sorts by it (see OnSortChange).

Touch

On a touch screen the grid follows the platform’s conventions:

Multi-selection

With egoMultiSelect in Options several rows can be selected; they are drawn with the selection tint and a disc in the gutter. On the desktop the rules are those of the VCL grid:

On a touch screen the grid follows Android’s selection mode instead (see TouchSelection): a tap or a long press on a row’s gutter starts it, then each tap selects or deselects a row, and a tap on the corner, or Back, clears it.

The selection is kept by row identity, so it survives scrolling and sorting. SelectedRowIds returns it, OnSelectionChange reports its changes, and ExportToXLSX can export only the selected rows.

See Also

(C) 2026 Easygate, Lda