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

# TCustomGrid.Col

Column index for the selected grid cell.

## Declaration

Source position: grids.pas line 1228

`protected property TCustomGrid.Col : Integer read FCol write SetCol;`

## Description

Col is an Integer which holds the column index for the current cell or grid cursor. The current grid column can be changed programmatically by setting a new value in this property.

Setting a new value for the property causes the limits for the column index to be checked when AllowOutboundEvents is set to False. An exception is raised in the CheckLimitsWithError method when the property value is not a valid column index for the grid control.

MoveExtend is called to move the selection to the cell at the coordinates in Row and Col. The cell editor is also retrieved (when available) and is displayed. The Click method is called to signal the OnClick event handler (when assigned) if the cell is not already selected or displaying a cell editor.

## See also

TCustomGrid.Row |  | Row number for the selected grid cell.
TCustomGrid.CheckLimitsWithError |  | Checks column and row limits for the specified cell, with error trapping.
TCustomGrid.MoveExtend |  | Moves the selected cell or extends a selection using the specified column and row values.
TCustomGrid.Click |  | Performs actions needed when a mouse click occurs in the grid control.
#lcl.controls.TControl.Click |  | Signals OnClick and/or executes the ActionLink when the control has been clicked.
#lcl.controls.TControl.OnClick |  | Notification handler for mouse clicks.