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

# TCustomDrawGrid.HeaderClick

Performs actions when a mouse click occurs in a header for a grid column.

## Declaration

Source position: grids.pas line 1431

`protected procedure TCustomDrawGrid.HeaderClick(`
`IsColumn: Boolean;`
`index: Integer`
`); override;`

## Arguments

`IsColumn` |  | True when a column has been clicked instead of a row.
`index` |  | Column or row number for the click notification.

## Description

HeaderClick is an overridden method ensures that the SortOrder for the grid is toggled when Index contains the SortColumn defined for the grid control. HeaderClick calls the inherited method in TCustomGrid to Sort the non-fixed rows in the grid control.

HeaderClick signals the OnHeaderClick event handler (when assigned) to performed any actions needed after the data has been sorted in the method.

## See also

TCustomGrid.HeaderClick |  | Performs actions needed when a mouse click occurs in a fixed header for a grid column or row.
TCustomGrid.SortColumn |  | Column number used to sort the rows in the grid.
TCustomGrid.SortOrder |  | Controls the order used for the sort column (ascending or descending).
TCustomGrid.Sort |  | Sorts rows or columns in the grid.