windows phone 8 - How to Delete Item from Observable collection in C# -
i working on windows phone app , want delete item listbox.
i using following code list numbers=new list();
observablecollection<string> mycollection = new observablecollection<string>(numbers); int indexperson = listbox1.selectedindex; mycollection.removeat(indexperson); var = (observablecollection<string>)listbox1.itemssource; listbox1.itemssource=my;
and when click on delete button 1 item deleted based on index , when delete item deleted item show , current deleted item deleted.
how can delete items?
if want clear items can use
mycollection.clearitems()
if want remove selected item use
mycollection.remove(listbox1.selecteditem)
Comments
Post a Comment