Topic: How to sort a TreView

Hello everyone and best wishes for 2023
I tried to use the Treeview integrated in MVD (Not great, the Delphi one is easier to use)
My problem is getting alphabetical sorting once I enter a new author (my MVD example is library management).

To force this automatic sorting, I use this instruction in the script (between Begin and End.):
Form1.TreeView2.dbCustomOrderBy := 'ParentID2, record_count';
Nothing works, the last author entered remains at the end of the list (see image).
The worst part is that it worked before.
Would you have an explanation?
Thanks for your help.
J.B.

Post's attachments

Attachment icon Sample.jpg 15.98 kb, 39 downloads since 2023-01-08 

Re: How to sort a TreView

jean.brezhonek wrote:

Form1.TreeView2.dbCustomOrderBy := 'ParentID2, record_count';
J.B.

возможно проблема тут
maybe the problem is here

'ParentID2, record_count'

Re: How to sort a TreView

Hello Vladimir

Well seen Vladimir!
What took me to sort on a number of records?
It was on the name of the author that it had to be done.
I changed this sort parameter to: 'ParentID2, Name' and everything is back to normal.
Thanks again Vladimir
J.B.