Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Is there are way to maintain a grid's edit row even after it has lost the focus?
posted

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.

  • 469350
    Offline posted

    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.