BaseObjectSpace.Rollback(Boolean) Method
Discards all unsaved changes made by users and invalidates previously loaded objects in the current Object Space.
Namespace: DevExpress.ExpressApp
Assembly: DevExpress.ExpressApp.v25.2.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Optional Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| askConfirmation | Boolean | True |
|
Returns
| Type | Description |
|---|---|
| Boolean |
|
Remarks
Use this method to cancel changes to persistent objects in the current Object Space. The built-in ModificationsController.CancelAction uses this method.
The Rollback method discards changes made by users to objects loaded by the current Object Space. If there are unsaved changes and the askConfirmation parameter is true (default), it raises the ConfirmationRequired event, and the handler’s ConfirmationResult determines what happens next:
Yes– The changes are discarded and objects reloadedNo– Rollback operation is aborted
Internally, the Rollback method behaves similarly to the Refresh method, with the key difference being that Rollback only offers Yes/No confirmation options (no Cancel option), and includes the askConfirmation parameter to control whether confirmation is requested.
If you call the Rollback method without parameters, the method prompts the following dialog:

To roll back an Object Space without a confirmation dialog, set the askConfirmation parameter to false.
The following events related to the Rollback method are available:
-
Handle this event to stop the
Rollbackmethod from rolling back. Set the handler’sCancelEventArgs.Cancelparameter totrue. BaseObjectSpace.CustomRollBack
Handle this event to perform a custom rollback instead of the default one. Set the handler’s
CompletedEventArgs.Handledparameter totrueto show that you already performed the rollback operation. Set the handler’sCompletedEventArgs.IsCompletedparameter to the value that theRollbackmethod returns.