listview - C# Copy/Move item from listview1 to listview2 with quantity -


i know how copy double-click item listview1 listview2, far had using code on listview1 mouse double click event.

foreach (listviewitem item in lvitemlist.selecteditems)         {             lvitembuy.items.add((listviewitem)item.clone());         } 

when double click on item copy selected item listview2, anyway not want..lets in listview1 got item:

id   |  itemname | quantity 1    |  item1    | 100 

what want everytime double-click on item on listview1, quantity should decrease 1, on listview1:

id   |  itemname | quantity 1    |  item1    | 99 

then added selected item listview2 1 quantity this:

id   |  itemname | quantity 1    |  item1    | 1 

after double click again on same item, same thing on listview1 dont want duplicate item on listview2. +1 quantity. there way this?

there many ways this. can introduce id's listviewitems. don't close listviewitem direct, instead write method copies properties first listviewitem second one. in method can decrease quantity , check if selected listviewitem in second listview


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -