c# - ListView Item not moving -


i'm trying move selected listview item / down via buttons. item deleted , inserted @ same index. want add @ index+1 (down) or index -1 (up)

i've got 4 items , tried move down item 2 (at index 1) here's example of down_click procedure

private void down_click(object sender, eventargs e) {     listviewitem selected = listview1.selecteditems[0];     int sel_index = listview1.selecteditems[0].index;     int newindex = sel_index + 1;     listview1.items.removeat(sel_index);     listview1.items.insert(newindex, selected); } 

you should change view mode of listview list :

listview1.view = view.list; 

i hope help.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -