I have bound the data to ListView from multiple sources. And there is duplicate data, I want to remove all the duplicates from that ListView. I used the following code but it is not helping.
listview.Sorting = System.Windows.Forms.SortOrder.Ascending;
for (int i = 0; i < listview.Items.Count - 1; i++)
{
if (listview.Items[i].Tag == listview.Items[i + 1].Tag)
{
listview.Items[i + 1].Remove();
}
}
foreachloop, but they're not.