Recent

Author Topic: TStringGrid Column sorting  (Read 324 times)

jcmontherock

  • Sr. Member
  • ****
  • Posts: 298
TStringGrid Column sorting
« on: May 05, 2025, 12:30:55 pm »
How to avoid sorting when clicking on header of fixed column ?
« Last Edit: May 05, 2025, 12:40:24 pm by jcmontherock »
Windows 11 UTF8-64 - Lazarus 4.0-64 - FPC 3.2.2

Zvoni

  • Hero Member
  • *****
  • Posts: 2981
Re: TStringGrid Column sorting
« Reply #1 on: May 05, 2025, 01:29:43 pm »
AFAIU: https://lazarus-ccr.sourceforge.io/docs/lcl/grids/tcustomdrawgrid.onheaderclick.html
Quote
Signalled from the HeaderClick method (when assigned). It occurs when a mouse up event or column accelerator key is handled for a header cell on the grid control.It occurs after the SortOrder and SortColumn have been updated and the Sort method has been called when ColumnClickSorts is enabled.
Simply put: You don't

Set ColumnClickSorts to False?
« Last Edit: May 05, 2025, 01:31:43 pm by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

jcmontherock

  • Sr. Member
  • ****
  • Posts: 298
Re: TStringGrid Column sorting
« Reply #2 on: May 05, 2025, 03:55:53 pm »
With "ColumnClickSorts := False", sort is done, but the picture indicating the sort direction does not appear.
Windows 11 UTF8-64 - Lazarus 4.0-64 - FPC 3.2.2

 

TinyPortal © 2005-2018