When binding a DataGridView control to a binding source, I’m getting the following error in my application:
Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function
The binding source depends on the data table. And I’m filtering the records from the DataGridView. And I used the dataGridView1_CellValueChanged() event where I’m filtering the DataGridView. But when I was deleting the data from the current cell, this error occurs.
How can I resolve this problem?
The exception is raised by the
DataGridViewin order to prevent an infinite loop from occurring. The cause of this is usually one of the following:DataGridViewis still using itHave a look at your handler for the
CellValueChangedevent and make sure you are not doing any of the above within the handler.