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

# TCustomGrid.CheckLimits

Checks column and row limits for the specified cell.

## Declaration

Source position: grids.pas line 998

`protected procedure TCustomGrid.CheckLimits(`
`var aCol: Integer;`
`var aRow: Integer`
`);`

## Arguments

`aCol` |  | Column number examined in the method.
`aRow` |  | Row number examined in the method.

## Description

CheckLimits is a procedure used to constrain the specified cell coordinates to the valid values for grid control.

ACol and ARow contain the column and row numbers for a cell in the grid control. CheckLimits ensures that the values represent a valid, non-fixed cell in the grid control.

ACol must contain a value in the range 0..ColCount-1, and cannot be a fixed column in the grid. The value in FixedCols is assigned to ACol if it is less than the value in FixedCols.ColCount-1 is assigned to ACol when it is larger than the upper limit.

ARow must contain a value in the range 0..RowCount-1, and cannot be a fixed row in the grid. The value in FixedRows is assigned to ARow if it is less than the value in FixedRows. RowCount-1 is assigned to ARow when it is larger than the upper limit.

CheckLimitsWithError is used when an exception is required for invalid cell coordinates.

CheckLimits is used in the implementation of methods like MoveNextSelectable and TryMoveSelection.