I am adding a row to a grid. In the middle of adding the row, I click on a treeview.
The grid's BeforeRowUpdate event fires, and because I only partially populated the row, I send a messagebox with error message to the user.
Then, because I clicked on the treeview, the mousedown event first for the tree view, and my original grid loses focus, and I lose the edit row that the user was working on.
Is there are way to maintain that edit row when the user clicks on another control?
I tried using the grid's ExitEditModeOnLeave = false, but then the BeforeRowUpdate event does not fire.
You may be able to do this using the UpdateMode property. By default, the grid updates the current row when losing focus. So you could set UpdateMode to OnUpdate.
But then you have to be sure to call UpdateData on the grid to commit any changes when you want to save.