Trick for Sort?

12 views
Skip to first unread message

Alejandro AG

unread,
May 28, 2025, 12:23:07 PMMay 28
to Rosi Delphi Components
The sorting of one or more columns work nice, but i need more (always more...)
I need sort automatically, when I press Date column, the sort will be "date,ID"
There is some way to connect a column with some sort specific?
May be you don't trap this behaviour and let the base component work in his way.

Just looking for a Clue

Tks 

Tomas Rosinsky

unread,
Jun 8, 2025, 5:20:18 PMJun 8
to Rosi Delphi Components
Hi,

possible solution depends on way of sorting used in your case.

If you are using some type of TrDBGridSorter then you have to create own version of the sorter and override SetSort_CreateIndex and add any additional field as another sorted field:

    { virtual procedure called to set sorting properties in dataset, MUST be override to provide sorting }
    function SetSort_CreateIndex(DataSet: TDataSet; const SortString: string; const SortFields: string; const DescendingFields: string): boolean; virtual;

You can also remove sorter and use directly OnChangeSortEx event for rDBGrid and again set also any additional field as another sorted field for your custom code for dataset sorting.

I hope it helps
Tomas
Dne středa 28. května 2025 v 18:23:07 UTC+2 uživatel aag.co...@gmail.com napsal:
Reply all
Reply to author
Forward
0 new messages