$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
ListView WinForms Control
Create functional user interfaces, display data, group, filter, sort, and customize data items
Home > WinForms UI Controls > User Manual > ListView Sorting in C#

C# Code for Sorting in ListView

Kettic ListView .NET Component allows the users to sorting items in ListView for C#.NET Windows Forms applications. It is possible to accomplish the items sorting functionality by using C# code or by click column header. The sorting feature can be performed in all views in ListView control. The sorting mechanism for ListView makes it easy to use the component for .NET project being deployed on other C#.NET applications.

How to Sort ListView Items in C#.NET

Kettic ListView .NET Component is capable of sorting items in C# code for ListView and by a header click. To perform the sorting items in C#, we need to add the appropriate SortDescriptor to the SortDescriptors collection of Kettic ListView control. To sort items by header click, we need to enable this functionality in clicking a column header in DetailsView.

How to Enable Columns Sorting for ListView

Kettic ListView control contains two properties to enable the items sorting on header click. They are EnableSorting and EnableColumnSort, which have to be enabled by setting their values to true. The following simple C# code snippet shows how to enable the two properties.

ketticListView1.EnableSorting = true;
ketticListView1.EnableColumnSort = true;

How to add add SortDescriptor to KetticListView in C#.NET

The C# code below shows how to add SortDescriptor to Kettic ListView control in Windows Forms template projects.

ketticListView1.EnableSorting = true;
SortDescriptor sort = new SortDescriptor("Free Space", ListSortDirection.Descending);
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls