Hi,
I have coded for find and remove the duplicate rows from datagrid view based on ID column(See the snap). But it not working...
Thanks to any one could assist me...
private void DelDuplicateData()
{
List<string> list1 = new List<string>();
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
string str = dataGridView1.Rows[i].Cells[2].Value.ToString();
if (!list1.Contains(str))
{
list1.Add(dataGridView1.Rows[i].Cells[2].Value.ToString());
}
else
{
dataGridView1.Rows.Remove(dataGridView1.Rows[i]);
}
}
}