How do I delete a row with a specified index in datagridview? So if I want to delete the row with index [2], then how can I do that?
I have tried:
for (int i = 0; i < dg1.Rows.Count; i++)
{
if (i == 2)//if iteration has reached index 2
{
dg1.Row[i].Delete;
}
}
I am using Winforms