Hi All,
could any one tell me how can i delete multiple items in listview control.
i do this before only for single item.
Thanks in AdvanceCode:ListView.Items.RemoveAt(ListView.SelectedItems(0).Index)
Regards
Gurmeet:thumb:
Printable View
Hi All,
could any one tell me how can i delete multiple items in listview control.
i do this before only for single item.
Thanks in AdvanceCode:ListView.Items.RemoveAt(ListView.SelectedItems(0).Index)
Regards
Gurmeet:thumb:
Are you populating the list box from a query if so use the work distinct.
No i am not populating the listview with a query. Well thanx for ur reply once again.
Any other Expert Guru of Listview? If exist then plz reply my question.
Regards
Gurmeet:thumb:
Hi Experts,
Is there no body who has faced the same problem. I dont think that any expert of vb.net could not faced it. plz Guide me what should i do. Any link on web or post will be appreicated.
Thanks in Advance
ss_gurmeet,
I cannot see the problem.
Are you talking about deleting the selected items in a multiselect listview?
The SelectedItems collection is updated for you when you delete an item, so delete allways the first element:
Hope it helpsCode:For i = 0 To ListView1.SelectedItems.Count - 1 ' This is evaluated only ONCE :)
MsgBox("Notice the updated count : " & ListView1.SelectedItems.Count.ToString)
MsgBox("Deleting item : " & ListView1.SelectedItems(0).Text)
ListView1.Items.RemoveAt(ListView1.SelectedItems(0).Index)
Next
Hi Deepbuti,
Thank you very much for ur information which u give me (The SelectedItems collection is updated for you when you delete an item, so delete allways the first element). its works fine now.
Best of Luck for ur bright future :thumb:
Regards
Gurmeet :)