TcxGridColumn.OnHeaderClick Event
Allows you to respond to clicks on the column header.
Declaration
property OnHeaderClick: TNotifyEvent read; write;
Remarks
The OnHeaderClick
event occurs every time a user clicks on the column header. For instance, you can handle the OnHeaderClick
event to sort data against the current column when sort operations are disabled (the Options.Sorting property is set to False
).
Code Example
The following code example sorts data against the current column when sort operations are disabled:
uses
..., dxCore;
//...
procedure TMyForm.Column1HeaderClick(Sender: TObject);
var
AColumn: TcxGridColumn;
begin
AColumn := Sender as TcxGridColumn;
if AColumn.SortOrder = soDescending then
AColumn.SortOrder := soAscending
else
AColumn.SortOrder := soDescending;
end;
See Also