0
shah123's Avatar
Contributor
It worked. Thanks added new function to check the duplication
Code:
private bool IsInCollection(ListViewItem lvi)
        {
            foreach (ListViewItem item in scheduleListView.Items)
            {
                bool subItemEqualFlag = true;
                for (int i = 0; i < item.SubItems.Count; i++)
                {
                    string sub1 = item.SubItems[i].Text;
                    string sub2 = lvi.SubItems[i].Text;
                    if (sub1 != sub2)
                    {
                        subItemEqualFlag = false;
                    }
                }
                if (subItemEqualFlag)
                    return true;
            }

            return false;

        }
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder