April 16th, 2012, 06:16 PM
How to sort different columns of different type of listview in VB.Net?
Using Microsoft Visual Studio 2010 Ultimate - VB.Net
I'm writing an application where as many of other applications fulfill the requirements to be as an app , having it's statistics schema. Thus I made a form where I have a combox(of query category), a textbox(as searchfield), two datetimepickers(from and to) a listview and a button to fire the event with functions in it. I'm all set except for a minor issue I've encountered during my very first experiments with ListView control. Thus far I didn't know that VB users are stuck with that control's property options (whereas DataGridView has way too many), especially when it came to Column reordering/s. With the simple but not satisfying property Sort I couldn't find a proper solution to my issue.
So frankly I'm asking for help that when I click on of the columns in the listview to do a Number/Date/Text reordering (descending>ascending, via-verse). Not to forget to mention there a limited number of columns most likely 2-4 max.
The listview control has lvResults name and has for now columns inserted as "Country" and the other for subitems "Total Spent".
One e.g. of the values inserted to it is like this :
If pressed on Total Spent, should reorder from highest to the lowest number and via-versa.
Country Total Spent
If pressed on Country should reorder from A to Z or via-versa.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.