DesktopListbox Sort by Code

I use this code to sort a ListBox (from documentation)

// Date column, descending order
Me.ColumnSortDirectionAt(0) = DesktopListBox.SortDirections
Me.SortingColumn = 0
Me.Sort

Unfortunately on the header the sort indicator is not shown as expected. It’s only visible when user click on col header cell

Capture d’écran 2023-04-05 à 09.43.21

Try adding:

Me.PressHeader(0)

Video:
ezgif.com-video-to-gif (6)

1 Like

:wink:Thank you @AlbertoD
That’s the solution! :+1:

Where is Me.PressHeader(0) added? At the top, at the bottom, in the middle?

Anywhere, top, bottom, middle.

Edit: note that there is code missing after .SordDirections either .Descending or .Ascending

1 Like