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

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -