//scope is same level as listView1 private List<string> strList = new List<string>();
if (! strList.Contains(epc)) { listView1.Items.Add(new ListViewItem(epc)); strList.Add(epc); }
foreach (ListViewItem l in listView1.SelectedItems) { strList.Remove(l.Text); l.Remove(); }
private string delimitedString = ""; //when adding item(s) to listview if (!delimitedString.Contains("|" + epc + "|")) { listView1.Items.Add(new ListViewItem(epc)); if (listView1.Items.Count == 1) { delimitedString = "|"; } delimitedString += epc + "|"; } //when removing item(s) also remove from the delimited string like this: foreach (ListViewItem l in listView1.SelectedItems) { delimitedString = delimitedString.Replace("|" + l.Text + "|", "|"); l.Remove(); }