I want to perform an Undo on the ultragrid or dataset. At the moment im doing the logic below, can you point me into the right direction
this.BindingSource.RaiseListChangedEvents = false; this.BindingSource.CancelEdit(); this.DataSet.RejectChanges(); this.ultraGrid1.UpdateData();
Hello,
Please look at the following links, where is explained when the changes of dataset/datatable should be rejected:
http://msdn.microsoft.com/en-us/library/system.data.dataset.acceptchanges%28v=vs.71%29.aspx
http://msdn.microsoft.com/en-us/library/system.data.dataset.rejectchanges%28v=vs.71%29.aspx
Please note that RejectChanges method reject the changes that are made after you were called accept changes.
Please let me know if you have any further questions.
I just got through trying the example. I notice if enter another row into the ultragrid. and dont accept changes. the reject works just find. But if I accept changes and then try to rejectchanges or reject the row I just added it does not work. Shouldnt I be able to save changes or add another row, accept the change and reject changes if i want
Thanks. I am getting ready to try now.
Can you send me a example of you using your cancel update method?
The grid supports a very limited undo functionality for multi-cell operations like Cut, Copy, and Paste.
But there is no undo in the grid for editing cells and such. The closest thing to undo like that is that you can cancel the change in the current cell or row using the CancelUpdate method.