Sorting ListView columns

OK. I've tried to research the best way to sort a ListView column with no clear answer. The best answer may be to create the various ListView tables manually according to column sorted and use them as needed. I've read various forum responses that sorting macros either aren't very good, aren't very fast, might not work as intended, or not be supported. So, how have all you ListViewers done your sorts the most efficient way? I have up to 300 entries in my table.
Last edited on
I haven't done this for a while, but as I recall, you pass in a sort flag on creation, then pass in your custom sort function.

I don't remember this being difficult.

Is this not correct?
Last edited on
It is kind of unusual to sort the colums. A simple way to change the order see this:

https://docs.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-listview_setcolumnorderarray

You still need to sort it yourself.
I don't want to change the order. I want to be able to sort the column alphabetically. I think the easiest way is to create a separate ListView table and do the sorting myself. The number of items will never change once the file is read into the table (user can't add or delete anything).
I don't want to change the order. I want to be able to sort the column alphabetically.
So how will you sort something without changing the order?

I think the easiest way is to create a separate ListView table and do the sorting myself.
A separate listview? For what?

It is actually very unclear what you are trying to do.

I have up to 300 entries in my table.
Sorting 300 entries is really no challenge for a decent modern computer...
Topic archived. No new replies allowed.