Click here to Skip to main content
15,881,413 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a window form listview with 2 columns
Now am able to do sort the 2 columns individually by clicking the header.

What actually i need is, if first column values are unique then it should sort its second column in ascending order.

e.g
Actual listview
colA colB
1 siva
2 elvis
1 ram
2 peter
1 Ajay
1 kumar
2 john

needed result

colA colB
1 Ajay
1 kumar
1 ram
1 siva
2 elvis
2 john
2 peter
Posted
Updated 28-Jan-13 23:03pm
v2

1 solution

Try this way:

C#
YourListView.Items.SortDescriptions.Add(new SortDescription("Column1"));
YourListView.Items.SortDescriptions.Add(new SortDescription("Column2"));
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900