Hi,
the problem is that when the deletion of the selected row in a grid is passed through to the database the deletion in the database can go wrong how can i stop the deletion of the row in the grid.
Regards
Ronny
Hi Ronny,
You can use the following WinGrid event:
http://help.infragistics.com/NetAdvantage/WinForms/2010.3/CLR2.0/?page=Infragistics2.Win.UltraWinGrid.v10.3~Infragistics.Win.UltraWinGrid.UltraGrid~BeforeRowsDeleted_EV.html
Within this event, you can iterate through the collection of rows that are marked for deletion and then try to delete them from your back end. If the operation fails (within a try-catch), you can cancel the WinGrid row deletion by setting the e.cancel property to True.
Another thing you can do instead of canceling the deletion is to reload your data once again, however this could be more expensive as you are re-querying your back end for everything.