Skip to main content

How to: Prevent Changes in a Persistent Object from being Automatically Committed

To prevent changes in a persistent object from being automatically committed to a database after you have finished editing its properties in a control bound to the object, override the default IEditableObject interface implementation as shown in the following code example.

public class PersistentClass: XPCustomObject {
    protected override void BeginEdit() { }
    protected override void EndEdit() { }
    protected override void CancelEdit() { }
}

Set the static XPBaseObject.AutoSaveOnEndEdit field to false to prevent the automatic saving of object changes, without having to override the default IEditableObject.EndEdit() method implementation.

See Also