0

I find out this code:

dataGridView1.Sort(dataGridView1.Columns[0],ListSortDirection.Ascending);

Is there anything like this but for listView in C#?

Edit: I have a listView like this.ListView

How can I sort lvi by Name or Last Name? I find out this but sort the lvi by Id.

listView_Test.Sorting = SortOrder.Ascending;
// or
listView_Test.Sorting = SortOrder.Descending;
Giovanni
  • 29
  • 7
  • 1
    Which listview are you talking about? Regardless, you might just want to sort the data instead of manipulating UI elements. – Crowcoder May 19 '20 at 11:40
  • Perhaps this helps [Is it possible to bind a List to a ListView in WinForms?](https://stackoverflow.com/questions/2799017/is-it-possible-to-bind-a-list-to-a-listview-in-winforms) – Barns May 19 '20 at 13:19
  • @Crowcoder I edit my topic so maybe now it is more clear – Giovanni May 19 '20 at 14:06

0 Answers0