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

# TCustomDrawGrid.CellClick

Performs actions to handle a mouse click in the specified cell.

## Declaration

Source position: grids.pas line 1418

`protected procedure TCustomDrawGrid.CellClick(`
`const aCol: Integer;`
`const aRow: Integer;`
`const Button: TMouseButton`
`); override;`

## Arguments

`aCol` |  | Column number for the cell.
`aRow` |  | Row number for the cell.
`Button` |  | Mouse button for the click notification.

## Description

CellClick is an overridden method used to handle a mouse click in the cell specified by the values in ACol and ARow. Button indicates the mouse button pressed for the click notification.

CellClick ensures that a left mouse button click causes the cell value in a column using the check box button style to be toggled. When Button contains mbLeft, the column is examined to determine if it uses the check box button style. When both conditions are met, the ToggleCheckbox method is called to update the cell value and display the correct bitmap for the check box state.

CellClick does not occur for a cell that is a fixed header for the column or the row.

CellClick is called from the MouseUp method when a mouse click occurs in a cell that has already been selected, or when AutoEdit has been enabled in the grid Options.

## See also

TCustomGrid.CellClick |  | Processes a mouse click in the cell at the given coordinates.