Why is my bound DataGridView throwing an "Operation not valid because it results in a reentrant call to the SetCurrentCellAddressCore function" error?

The exception is raised by the DataGridView in order to prevent an infinite loop from occurring. The cause of this is usually one of the following:

  • Changing the active cell while an operation is being performed on the currently-active cell
  • Beginning, ending or cancelling edit mode while a cell edit is already in-progress
  • Any other operation that results in the active cell being changed while the DataGridView is still using it

Have a look at your handler for the CellValueChanged event and make sure you are not doing any of the above within the handler.


This most likely caused by you attempting to refresh a DataGridView after a save. I suggest you invoke the method rather than just calling it.

   BeginInvoke(new MethodInvoker(PopulateControl ));

I found this exception happened because I had an empty DataGridView.CellValidated sub in my code. Once I deleted that empty sub the error went away.