Hello all,
Can some one tell me how we can cancel all updates on webdatagrid (CRUD) ? Suppose that user had added some rows, removed others and updated any cells. After all this he decided to cancel all (To go to have lunch).
All what i know is to ovoid updates for adding and updating using RowAdding and RowUpdating server side events.Thank you very very much for your help
Hafid
Hello Hafid,
Did you downloaded and tested the example that I have provided you?
There is showed how you can use Manual CRUD to Add, Update and Delete rows in the grid. In order to save the changes that you have made to the grid you must save your changes to the data source and then rebind the grid.
If you do not save changes to the data source the changes made in the grid will not be persistent – that is how you can control what changes to save and what changes to discard.
Let me know what type of further assistance you need regarding this question.
Hello Alexander,
Not yet,
When i have received your answer i worked to use RowAdding, RowUpdating and RowDeleting events. I wrote few lines under any one of these events. I canceled using a temporary array initialized when i put my grid in edit mode. I used this dirty method because i wasted any time with webdatagrid and my project sets of the delay.
Thank you for responding. I promise that i will download your sample and test it.
Let me know if you have any further questions when you have time to view and test the provided sample.
I'm having issues with this also. Setting AutoCRUD to false and handling the rowupdating event on the server is fine, but the code you provided will ALWAYS cancel changes then. The initial question, and the one I have, is that you'd likely have two buttons at the front end, one to SAVE changes, the other to CANCEL them.
The row updating event fires on postback, BEFORE the button event fires. So I have no way to tell which button was clicked, and therefore whether e.cancel should be true or false.
How can this be set up so that you choose whether or not to cancel based on the button that was clicked on the form, if the row updating event fires before the button event?
Having same issue. Have you found a solution to this?
Thanks