Cher
Cher

Reputation: 2947

How to sort a ListView by a column?

So far I'm able to sort a ListView:

lsvRequestParameters.Sorting = SortOrder.Ascending;

However, doing so list from the first column. Is there a way to sort from a column other than the first one?

Upvotes: 1

Views: 84

Answers (1)

Jonathan Van Dam
Jonathan Van Dam

Reputation: 646

Just change the item sorter

listView1.ListViewItemSorter = new ListViewItemComparer(columnToBeSortedBy);

Upvotes: 2

Related Questions