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

# TCustomGrid.GetColumnColor

Gets the Color used to render the background for the specified column number.

## Declaration

Source position: grids.pas line 1090

`protected function TCustomGrid.GetColumnColor(`
`Column: Integer;`
`ForTitle: Boolean`
`):TColor;`

## Arguments

`Column` |  | Column number examined in the method.
`ForTitle` |  | True when the color for the title in the column is needed.

## Function result

Color the column.

## Description

GetColumnColor ensures that the correct color value is used to render the background for the specified column number.

When the Columns collection has been enabled, the color is retrieved from the TGridColumn instance. The Color property in TGridColumn is used when ForTitle is set to False. Otherwise, the Color in the Title for the column instance is used.

If the Columns collection has not been enabled, the color is retrieved from the Color or FixedColor properties in the grid control. FixedColor is used when ForTitle is set to True.

GetColumnColor is called from the PrepareCanvas method.

Use properties like AlternateColor, FixedHotColor, FocusColor, and SelectedColor to control when the corresponding Options are enabled for the grid control.