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

# TCustomGrid.CellExtent

Gets the last column number for the cell extent at the specified column and row.

## Declaration

Source position: grids.pas line 997

`protected procedure TCustomGrid.CellExtent(`
`const aCol: Integer;`
`const aRow: Integer;`
`var R: TRect;`
`out exCol: Integer`
`);`

## Arguments

`aCol` |  | Column number for the cell extent.
`aRow` |  | Row number for the cell extent.
`R` |  | TRect with the bounds for the cell extent.
`exCol` |  | Last usable column number for the cell extent.

## Description

CellExtent gets the extent rectangle for the cell at the coordinated in ACol and ARow. The rectangle bounds in R are updated by calling the CalcCellExtent method.

exCol is updated in the method to reflect the last visible column in the cached grid information for the cell extent. The ColRowToOffset method is iteratively called until the extent exceeds the cached right-most column for the visible area in the grid.

CellExtent is called from the DrawRow method when column spanning is enabled in the Options for the grid control.

Remark: | The current implementation does not account for BIDI mode or Right-to-Left usage.