Sorting a ListView by column? 
Author Message
 Sorting a ListView by column?

How to sort a listview in details by it's column?

I had added the ListViewItem & SubItem object. As well as
subscribing to the column click event in my listview.

I want to sort the columns whenever I click on them.

Thanks!



Fri, 25 Feb 2005 21:32:22 GMT  
 Sorting a ListView by column?
Ho,

    If you want, you can implement the IComparer interface that implements
the Compare method for comparing your two items in the listview.  Once you
have this, set the ListViewItemSorter property on the listview to an
instance of this, and it will sort your columns according to the criteria
you have set in the Compare method.

    Hope this helps.

--
               - Nicholas Paldino [.NET/C# MVP]



Quote:
> How to sort a listview in details by it's column?

> I had added the ListViewItem & SubItem object. As well as
> subscribing to the column click event in my listview.

> I want to sort the columns whenever I click on them.

> Thanks!



Fri, 25 Feb 2005 21:45:01 GMT  
 Sorting a ListView by column?
Hi,

  You can also set the sort routine that is used using the Sort property for
custom sorting.

  - Bruce.



Quote:
> Ho,

>     If you want, you can implement the IComparer interface that implements
> the Compare method for comparing your two items in the listview.  Once you
> have this, set the ListViewItemSorter property on the listview to an
> instance of this, and it will sort your columns according to the criteria
> you have set in the Compare method.

>     Hope this helps.

> --
>                - Nicholas Paldino [.NET/C# MVP]



> > How to sort a listview in details by it's column?

> > I had added the ListViewItem & SubItem object. As well as
> > subscribing to the column click event in my listview.

> > I want to sort the columns whenever I click on them.

> > Thanks!



Sat, 26 Feb 2005 16:50:22 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ListView Sorting by Column

2. Sorting multi column ListView -code-Any better ideas?

3. ListView.Sort() restores columns order

4. Listview Sorting by Columns

5. how to sorting listview columns?

6. Sorting ListView Box Columns

7. Sorting ListView Columns

8. sorting a listview based on column

9. example: sorting listview columns

10. sorting columns of a listview

11. Sort ListView By Arbitrary Column?

12. ListView: How to sort the 2nd column ?

 

 
Powered by phpBB® Forum Software