From dde9615abdcae0717ba62da6643abce4d8012276 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sun, 22 Jan 2023 12:57:14 +0100 Subject: [PATCH] Find a better alternative to d262a6acc920083e0728c324a968f83f11f263b7 : set descending column order on first header click when shift key is pressed . See https://www.heidisql.com/forum.php?t=40243 --- source/main.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/main.pas b/source/main.pas index b32f6df5..a9a98f79 100644 --- a/source/main.pas +++ b/source/main.pas @@ -10292,6 +10292,7 @@ var frm: TForm; ColName: String; SortItem: TSortItem; + SortOrder: TSortItemOrder; begin if HitInfo.Column = NoColumn then Exit; @@ -10312,7 +10313,11 @@ begin FDataGridSortItems.Remove(SortItem); end else begin - SortItem := TSortItem.Create(ColName, sioAscending); + if KeyPressed(VK_SHIFT) then + SortOrder := sioDescending + else + SortOrder := sioAscending; + SortItem := TSortItem.Create(ColName, SortOrder); FDataGridSortItems.Add(SortItem); end;