When I am trying to Delete all rows in DataGridView
I got this exception
Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore Function
Notes :
I tryed this
datagridview1.Rows.Clear();
and this
foreach (DataGridViewRow item datagridview1.Rows)
{
datagridview1.Rows.Remove(item);
}
and this
foreach (DataGridViewRow item datagridview1.Rows)
{
datagridview1.Rows.RemoveAt(item.index);
}