c# winform - how to delete multiple DataGridViewRows
Here is m code:
foreach (DataGridViewRow r in dgv01.Rows)
if (r.Cells[0].Value.ToString() == abc)
{
dgv01.Rows.Remove(r);
//dgv01.CurrentCell = dgv01.Rows[0].Cells[0]; - also tried
}
But only some rows are deleted - not all specified !?
Why - foreach - does not mean - foreach ?