Click to See Complete Forum and Search --> : How to get back the default sort in listview


Xaeryan
October 20th, 2002, 01:08 AM
I followed the MS code for sorting using your own method by setting a listview sorter property to my own compare class
(*** listView1.ListViewItemSorter = new MyComparer(e.Column); ***)
but I need it to go back to the default one in certain situations. How do I get back to the default?
(*** listView1.ListViewItemSorter = <default???> ***)
I made my own to sort the same way it does by default, but it runs much slower. Thanks.

Athley
October 21st, 2002, 02:20 AM
Have not tried it myself but an idea that came to mind was:

Create an own ListViewItem Class where you inherit from the original class and then create an index property for the new class. Set this property to an index for every item added to the ListView and then sort the ListView on the index property.

/Leyan