Listbox Sort Help page

ListBox Help page
If you click the HeadingIndex page you see an exemple with SortedColumn (in the exemple and a link to) but SortedColumn is deprecated, we have to use SortingColumn ;
I think this should be corrected.

My question is about HeadingIndex. I thought it was just an indication ^ or ∨ and that’s the difference with SortingColumn .
If I do

MyListbox.SortingColumn = 2
MyListbox.ColumnSortDirectionAt(0) = ListBox.SortDirections.Ascending
MyListbox.HeadingIndex = 5
MyListbox.Sort

It is suppose to indicate the ^ or ∨ on column 5 but do the comparerows on column 2 right? I made some test and it seems to be that.
But in the HeadingIndex page it is written :
Allows you to get and set the sort column in a **ListBox** . The first column is numbered zero.
and two lines below it’s written :
Using this property sets the sort direction indicator in the header.
That is good and the first sentence is wrong, isn’t it ? HeadingIndex is just an indicator, nothing more ? The fist sentence should be :
Allows you to get and set the sort column **indicator** in a **ListBox** . The first column is numbered zero.

Edit : If, in a button, I enter the code :

MyListbox.HeadingIndex = 3

then the sort is launched ! Why then, in the exemple above it is written MyListbox.Sort as it is not necessary.

Well, imagine you are sorting your list in a certain way before displaying it, then it makes sense to set the sort indicator to the appropriate direction. Plus you can can set it to “none”, if you don’t want the enduser to sort a column at all.

If you set the index it automatically starts the sorting, as this is similar to the end user clicking on the header of that column.

If I’m right with my assumptions then I do agree that adding indicator to documentation will clarify the situation.

Refrehing the header should show the indicators.

1 Like

Listbox.None seems to not be a instruction, it generate an error. We can enter Listbox.NoSelection but I don’t know what it is.

I was not at my computer. This is the right statement:

myListBox.ColumnSortTypeAt(0) = WebListBox.SortTypes.Unsortable