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

# TDBGridColumns.ColumnFromField

ColumnFromField returns the collection item for the specified Field.

## Declaration

Source position: dbgrids.pas line 304

`protected function TDBGridColumns.ColumnFromField(`
`Field: TField`
`):TColumn;`

## Arguments

`Field` |  | Field to locate in the collection.

## Function result

Collection item for the specified Field.

## Description

ColumnFromField returns the collection item for the specified Field. The return value is Nil when Field has not been assigned.

ColumnFromField iterates over the Items in the collection to locate the specified Field. The return value is Nil when Field cannot be located in the Items for the collection.

ColumnFromField is used in the TDBGrid.AddAutomaticColumns method.