Sorting Listview Items.

vishalneeraj-24503
Posted by vishalneeraj-24503 under C# category on | Points: 40 | Views : 1532
With the help of List View Sorting method,we can sort any List-view items.
SortOrder is an Enumeration which has Ascending,Descending,None values in it.

For Example:-

lst_view_names.Items.Add("Vishal");
lst_view_names.Items.Add("Pooja");
lst_view_names.Items.Add("Rajesh");
lst_view_names.Items.Add("Nitin");
lst_view_names.Items.Add("Vipin");

lst_view_names.Sorting = SortOrder.Ascending;


After sorting,lst_view_names will have names in alphabetical order as shown below:-

Nitin
Pooja
Rajesh
Vipin
Vishal

Comments or Responses

Login to post response