Undo specific property

Undo specific property

Old forum URL: forums.lhotka.net/forums/t/5563.aspx

jfreeman posted on Thursday, October 09, 2008

Is it possible to undo/restore a single field/property on an object?  Here is my scenario:

User enters a value into a textbox.  My BusinessBase object calls a method to check the value.  If the value entered by the user does not meet certain criteria, I want to set the value back to its original value.  All the other fields on the object need to stay at their current value.  I only want to restore the one value that has been modified. 

Is that possible?  Thanks.


rsbaker0 replied on Friday, October 10, 2008

Yes, you can do this in a validation rule -- just put the property value back to what you want it to be. (It's not exactly a typical undo scenario).

You'll need a BindingSourceRefresh extender control on your form if using Windows Forms because of a quirk in the binding that won't pick up changes to a property value while the binding is pulling a previous change from the control to your object.

Copyright (c) Marimer LLC