My tests certainly do not cover all circumstances, but what I have seen, is 
that 4D clears the header information (sets all the button values to zero) as 
soon as you change something in the listbox, e.g. add a row or column.

IMHO it is better to have a variable to store the sorted column (text, header 
object name) and another variable to store the sort order (longint)

I save the information (which column sorted and sort order) using the On After 
Sort event of the listbox.

Since you can place variables on the form without assigning a variable name, 
this can be done without declaring any additional process variables.

Olivier

-----Ursprüngliche Nachricht-----
Von: 4D_Tech [mailto:[email protected]] Im Auftrag von Arnaud de 
Montard
Gesendet: Donnerstag, 25. August 2016 12:38
An: 4D iNug Technical <[email protected]>
Betreff: Re: Keeping Sorts in a Listbox


> Le 24 août 2016 à 22:53, Sannyasin Siddhanathaswami <[email protected]> a 
> écrit :
> 
> Aloha,
> 
> Thanks Arnaud for the code to get the sort of a header clicked [...] 
> Any clue how to keep the FirstName Asc sort?

If you can get the sort from the header button, you may also use this button as 
a keeper, schematically:

  Order by ([members];[members]FirstName;>)
  set header button of column [members]FirstName to ascending

--
Arnaud de Montard




**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to