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

# TCustomGrid.OnBeforeSelection

Event handler signalled before changing the Selection in the grid control.

## Declaration

Source position: grids.pas line 1305

`protected property TCustomGrid.OnBeforeSelection : TOnSelectEvent read FOnBeforeSelection write FOnBeforeSelection;`

## Description

OnBeforeSelection is a TOnSelectEvent property with the event handler signalled prior to changing the Selection for the grid control. OnBeforeSelection can be used to perform actions needed before the Selection is moved and an Editor is displayed for the newly selected cell.

OnBeforeSelection is triggered (when assigned) from the MoveExtend method, and occurs when a new column or row is selected in the grid using keyboard navigation, using the mouse, or by assigning values to the Col or Row properties. It is also triggered when an explicit value is assigned to the Selection property.

Use OnAfterSelection to performs actions needed after the Selection has been changed and the Editor has been displayed.