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

# TCustomDrawGrid.DefaultDrawCell

The default method used to draw the cell at the given position using a specific state.

## Declaration

Source position: grids.pas line 1463

`public procedure TCustomDrawGrid.DefaultDrawCell(`
`aCol: Integer;`
`aRow: Integer;`
`var aRect: TRect;`
`aState: TGridDrawState`
`); virtual;`

## Arguments

`aCol` |  | Column number for the cell.
`aRow` |  | Row number for the cell.
`aRect` |  | Rectangle with the bounds for the cell.
`aState` |  | Drawing state for the cell.

## Description

DefaultDrawCell is a method which provides the default drawing routine for the cell at the position specified in ACol and ARow. The bounds for the cell are provided in the ARect parameter. AState contains the drawing state for the cell.

DefaultDrawCell handles the following drawing tasks when needed for the specified cell:

- Draws fixed cells using the TitleStyle for the control. Calls DrawThemedCell when TitleStyle is set to tsNative. Otherwise, DrawFillRect is used.
- Draws the bitmap needed for a cell using the check box button style. Calls DrawCellCheckboxBitmaps to render the bitmap for the check box control.
- Draws a cell using the Button style. Calls DrawButtonCell to render the button in the required state.
- Draws auto-numbered fixed row headers when enabled in the Options for the control. Calls DrawCellAutonumbering to render the relative non-fixed row number.
- Draws the text displayed in the cell. Calls DrawColumnText when the cell is a fixed column header. Otherwise, the DrawTextInCell method is used.

DefaultDrawCell is called from the DrawCell method. It is used when the DefaultDrawing property is set to True, and occurs prior to signalling the OnDrawCell event handler (when assigned). It is always called when OnDrawCell has not been assigned.

## See also

TCustomDrawGrid.DrawCell |  | Draws the content for the cell specified in the ACol and ARow arguments.
TCustomDrawGrid.DefaultDrawing |  | Indicates if the default drawing mechanism is used to draw the background and text for cells.
TCustomDrawGrid.OnDrawCell |  | Event handler signalled to draw a cell in the grid control.
TCustomGrid.TitleStyle |  | The drawing style used for the fixed column titles.