How to sort multiple columns in Visual Basic 6 ListView?

I am working in Visual Basic 6 and have to sort by multiple columns in a ListView. For example, sorting the list of music by artist, then album, then track number. As far as I know, VB6 does not support this out of the box. Here are the suggestions I've already heard:

  • First sort the data in the SQL table and display the data in the resulting order
  • Sort data in an ADO record object in memory
  • Sorting by the main column, and then executing the algorithm of sorting by elements, moving them to the correct positions manually

Does anyone have any experience with sorting multiple columns in VB6 that could give advice?

+4
source share
2 answers

I would create a hidden column in a listview that combines these three columns and sorts using this

+3
source

You can try sorting using the Windows API and callbacks: Link

Alternatively, you can try switching to vbAccelerator ListView ; I highly recommend it.

+2
source

Source: https://habr.com/ru/post/1276556/


All Articles