Is there a way to solve this? I could catch the closing of the application and simulate a BeforeRowUpdate but that doesn't seem good practice...
So I changed something in the row and when leaving it, it gets saved. Closing the application however with the windows X doesn't trigger the event.
Actually, I just realized my solution is wrong. You should call grid.UpdateData() not grid.Update().
I'll check this latern on and mark your answer if it works. But I'm pretty confident that your solution will fix it. thx.
Hello lievencardoen,
I wanted to know if you were able to solve your issue based on these suggestions or you still need help. Please let me know.
Hi,
The event fires when the grid attempts to commit pending changes to the data source. This happens based on the UpdateMode property. By default, it's when the grid loses focus or you move to another row.
Clicking on the 'X' doesn't take focus away from the grid or change rows, so there's nothing to trigger the update.
What you should do is handle the Form_Closing event and call grid.Update(). This will tell the grid to commit any pending changes.