Sign in Join
FPDoc Onlineexperiment

TCustomGrid.GetColumnColor function

Member of TCustomGridprotectedIn unit Grids

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

Declaration

pascal
function GetColumnColor(Column: Integer; ForTitle: Boolean): TColor

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.

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.