Sorting a C # list is successful, but trying to move the scroll bar up ... how?

The listview was sorted and tried to “refresh” it by selecting the first item and thus placing the scroll position at the top, but it doesn’t quite work. Here is my code:

if(lv_sets.SelectedItems.Count > 0) { lv_sets.SelectedItems[0].Selected = false; } if (columnSorter.SortingOrder == SortOrder.Ascending) { columnSorter.SortingOrder = SortOrder.Descending; lv_sets.Sort(); } else { columnSorter.SortingOrder = SortOrder.Ascending; lv_sets.Sort(); } lv_sets.Items[0].Selected = true; //This selects the item but it doesn't move the scrollbar to the top. Why? 
+4
source share
1 answer
 lv_sets.Items[0].EnsureVisible() 
+6
source

All Articles