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

# TCustomGrid.DrawCellText

Draws the specified text in the given text rectangle.

## Declaration

Source position: grids.pas line 1060

`protected procedure TCustomGrid.DrawCellText(`
`aCol: Integer;`
`aRow: Integer;`
`aRect: TRect;`
`aState: TGridDrawState;`
`aText: string`
`); virtual;`

## Arguments

`aCol` |  | Not used in the current implementation.
`aRow` |  | Not used in the current implementation.
`aRect` |  | Text rectangle for the text drawn on the control canvas.
`aState` |  | Not used in the current implementation.
`aText` |  | Text drawn in the method.

## Description

DrawCellText is a procedure used to draw the text specified in AText using the given text rectangle on the Canvas for the control. The Canvas also contains the alignment and layout used for the text drawn in the method.

ARect contains the Canvas coordinates for the text is drawn. DrawCellText adjusts the bounds in ARect to account for the cell padding used in the control (varCellPadding) as needed for the text alignment and layout. The TextRect method in the Canvas is called to render the text.

Values in the ACol, ARow, and AState parameters are not used in DrawCellText.

DrawCellText is used in the implementation of the DrawColumnText, DrawCellAutonumbering, and DrawTextInCell methods where AText contains the column title, row number, or content for a given cell.