How to move a list item up or down by clicking a button

I have items in the list and I want to know how to add 2 buttons that make the item move up in the list and one that makes the item move down in the list. I am figuring out how to do this with lists, but I can't figure out where to do this to view the lists, and help is appreciated.

+5
source share
1 answer

Check the Listview.Items.Remove and Listview.Items.Insert methods:

listView1.Items.Remove(selectedItem);
listView1.Items.Insert(newIndex, selectedItem);

( ListViewItem , , ) . , , , .

, .

+11

All Articles