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

# TCustomDrawGrid.GetCells

Gets the value for the specified cell.

## Declaration

Source position: grids.pas line 1427

`protected function TCustomDrawGrid.GetCells(`
`ACol: Integer;`
`ARow: Integer`
`):string; override;`

## Arguments

`ACol` |  | Column number for the cell value.
`ARow` |  | Row number for the cell value.

## Function result

Value for the specified cell.

## Description

GetCells is an overridden method in TCustomDrawGrid used to get the String value for the cell specified in the ACol and ARow arguments. It calls the inherited method on entry - which always returns an empty string ('') as the cell value.

When ACol and ARow contain the column and row coordinates for the cell Editor, the value for the cell is retrieved by dispatching a GM_GETVALUE message to the Editor control. This occurs when the control has been assigned and its Visible property is True. The value returned in the grid message is used as the return value for the method.

GetCells is called from EditorShow method.

## See also

TCustomGrid.GetCells |  | Gets the cell content at the specified column and row numbers.
TCustomGrid.Editor |  | The editor control used to modify the value in the current cell.
TCustomGrid.EditorShow |  | Displays the Editor for the selected cell.