e.Record.CancelUpdate(); is not working for grd_CellUpdated()
Please help me.
Hello,
I am not completely sure,but I believe this is because of IEditableObject interface. CanceUpdate will cancel it if you implement IEditableObject on your underlying class. The DataTable (DataView) implements that interface so that if you use a DataTable, this would be working. I also tried with a custom class which implements IEditableObject, and it is also working.
You can see a sample implementation by Microsoft in the MSDN here:
http://msdn.microsoft.com/en-us/library/system.componentmodel.ieditableobject.aspx
Hope this helps.
This is not helping me too much I am not using DataTable.
I am hendling it through maintaining Olddata variable.
Is there any direct way in infragistic control so that I could cancel My last Update.
As well as i Can't set "e.ChangesAccepted = true" in EditModeEnded Event as this is read only.
please suggest me some direct way.
thanks in advance .
Amit mittal
Amit,
As I said, if you want that directly with, you would have to implement the IEditableObject interface.
You can of cource do that manually, by Saving the old Value of the cell in a local variable when you start updating it. When you end updating, you can check if you need to revert that value and switch back to the old one using the local variable. You can use for example - EditModeStarting, CellUpdating, CellUpdated events.