[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Grids' (#lcl)

# TCustomGrid.MoveSelection

Signals the OnSelection event handler for a new mouse selection.

## Declaration

Source position: grids.pas line 1158

`protected procedure TCustomGrid.MoveSelection; virtual;`

## Description

MoveSelection signals the OnSelection event handler (when assigned) using the values in Col and Row as arguments.

Use The OnBeforeSelection, OnSelection, and OnAfterSelection event handlers to perform actions needed before, during, or after a range is selected on the grid control.

Use OnSelectCell to determine whether a specific column and row number can actually be selected.

Called from the MouseDown method when a mouse click in the non-fixed area for the grid is detected. It is also called from MoveExtend when range selection (goRangeSelect) is enabled in the Options for the control.

## See also

TCustomGrid.OnSelection |  | Event handler signalled when an area is selected in the grid control.
TCustomGrid.OnBeforeSelection |  | Event handler signalled before changing the Selection in the grid control.
TCustomGrid.OnAfterSelection |  | Event handler signalled after a new Selection is made in the grid.
TCustomGrid.Options |  | Contains the set of optional features and/or behaviors enabled for the grid control.
TCustomGrid.MouseDown |  | Handles mouse down events for the grid control.
TCustomGrid.MoveExtend |  | Moves the selected cell or extends a selection using the specified column and row values.