Skip to content

How to remove specific item from ListView

shah

Asked May 4, 2007, 1:45 AM EDT1 answer
Share
LinkedInX
I am trying to remove item from ListView but when i click on remove it doesnt remove the last item or in the middle but when i select the first item it removes. How is it possible to remove any selected item in the list? [code] private void removeBtn_Click(object sender, EventArgs e) { for (int i = scheduleListView.SelectedItems.Count - 1; i >= 0; i--) { if (scheduleListView.Items[i].Selected) { scheduleListView.Items.Remove(scheduleListView.Items[i]); } } } [/code] Thanks

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 1 short reply
    • 0
      It worked. Thanks
      0