I have two unbound DataGridView's on the same form. They are configured in a parent-child arrangement. I want to prevent the navigation to a different row in the parent when there are unsaved changes in the child. In the CellEnter event of the parent, I set the parent's CurrentCell back to the row where there are unsaved children. However, this errors out with a "Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function." message.
Is there any way to prevent users from navigating to any other row in a DataGridView, other than the current row, but allow them to navigate to the outside of the DataGridView (i.e. for Save\Cancel buttons). This scenario seems like it should be fairly common, but I can't find anything on preventing the navigation from row to row, except for the RowValidating event which prevents the navigation to the outside of the grid as well.
Any ideas?
Is there any way to prevent users from navigating to any other row in a DataGridView, other than the current row, but allow them to navigate to the outside of the DataGridView (i.e. for Save\Cancel buttons). This scenario seems like it should be fairly common, but I can't find anything on preventing the navigation from row to row, except for the RowValidating event which prevents the navigation to the outside of the grid as well.
Any ideas?