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

# TGridColumns.IndexOf

Gets the ordinal position in the collection for the specified column.

## Declaration

Source position: grids.pas line 665

`public function TGridColumns.IndexOf(`
`Column: TGridColumn`
`):Integer;`

## Arguments

`Column` |  | Grid column to locate in the collection.

## Function result

Ordinal position for the collection item, or -1 when not found.

## Description

IndexOf is an Integer function used to get the ordinal position in the collection for the TGridColumn instance specified in Column. The return value contains the ordinal position (in the range 0 to Count-1), or -1 when no items exist in the collection or when Column cannot be located in the container.

## See also

TGridColumns.Items |  | Provides indexed access to column definitions in the collection.
TGridColumn |  | Implements a column definition used for tabular data in TCustomGrid.
TCollection.Count