Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
SQL Server

How to sort ListViewItems in Visual Studio 2005

Author: Faraz

In this sample I will try to explain you a tip that will help you out in sorting ListViewItems.

Majority of time we need to maintain a list of item in a ListView control so that when items are added in our list it should be displayed in a proper manner, for this, all we need is displayed our list either in Ascending or in descending order or you have the third option simply call the Sort() Method. To see these works consider the following steps:


  • To simply sort the items in ListView control:



  • To Sort the Items in Ascending order:

lvSortList.Sorting = SortOrder.Ascending


  • To Sort Items in Descending order:

lvSortList.Sorting = SortOrder.Descending


Note: You can also set these properties from Property Window. Or you can do programmatically like I have done above.

Add Article Comment:
Name :
Email Address :
Comments :
<< How to use intelli-sense in ComboBox Control

Disclaimer - Privacy
© 2002-2017