We help IT Professionals succeed at work.

How do I sort a listview by a specific column in Visual Basic 2005?

I want to be able to sort a ListView by a specific column in Visual Basic 2005. Microsoft has an article for it at http://support.microsoft.com/kb/319399 but the instructions for doing this in Visual Basic 2005 are lacking. What modifications should I make to make the article code work? Or any other suggestions?
Comment
Watch Question

My suggestion would be to change your SQL statement to ORDER by your field and then refresh the ListView.  Will this work for you?

Author

Commented:
I am not using a binded Listbox and it is not related to an Specific table in the database so no it wouldn't work
Is this static data?  Otherwise, can you show the code for retrieving your data?

Author

Commented:
nope it is dynamic data that is retrieved from the contents of a form

Author

Commented:
the data looks somewhat like this

Some group
Detail                                                     Location
Some detail here                                          AF

I want to sort by the location column

Author

Commented:
Nobody has so far been able to answer thi question please proceed to closing it
Commented:
I ended up reordering the data myself before doing the loading on the listview but that wasn't the idea

Explore More ContentExplore courses, solutions, and other research materials related to this topic.