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

# TCustomGrid.ColumnIndexFromGridColumn

Gets the position of the specified column relative to the first column in the grid.

## Declaration

Source position: grids.pas line 1009

`protected function TCustomGrid.ColumnIndexFromGridColumn(`
`Column: Integer`
`):Integer;`

## Arguments

`Column` |  | Column number to locate in the grid.

## Function result

Relative position for the specified column.

## Description

ColumnIndexFromGridColumn is an Integer function used to get the position of the specified column relative to the first column in the grid. The return value contains the difference between Column and FirstGridColumn when Columns have been enabled in the grid control. RealIndex is called to translate the position used in the return value. If Columns have not been enabled, the return value is -1.

ColumnIndexFromGridColumn is used in the implementation of TCustomGrid methods like:

- ColumnFromGridColumn
- DoOPExchangeColRow
- DoOPInsertColRow
- DoOPMoveColRow
- DoOPDeleteColRow

## See also

TCustomGrid.ColumnFromGridColumn |  | Returns the grid column definition at the specified position in Columns.
TCustomGrid.DoOPExchangeColRow |  | Performs an exchange of values for the columns or rows with the specified indexes.
TCustomGrid.DoOPInsertColRow |  | Performs an insert operation for a column or a row at the specified position.
TCustomGrid.DoOPMoveColRow |  | Performs a move operation for the column or row at the specified position.
TCustomGrid.DoOPDeleteColRow |  | Performs a delete operation for a column or a row.