Skip to main content

BaseObjectSpace.Refresh() Method

Invalidates all previously loaded objects in the current Object Space and resets any unsaved changes made by users.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v25.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public bool Refresh()

Returns

Type Description
Boolean

true if persistent objects were refreshed; otherwise, false.

Remarks

The Refresh method resets objects loaded by the current Object Space. Additionally, if there are unsaved changes, it raises the ConfirmationRequired event, and the handler’s ConfirmationResult determines what happens next:

  • No – The changes are reloaded
  • Yes – The changes are saved and reloaded
  • Cancel – Refresh operation is aborted

The Refresh method resets all unsaved changes and invalidates previously loaded objects. If the method completes successfully, it returns true.

Use this method to update the current Object Space’s persistent objects. For example, the built-in RefreshController.RefreshAction Action uses this method.

The following events related to the Refresh method are available:

  • BaseObjectSpace.Refreshing

    Handle this event to prevent the Refresh method from refreshing. Set the handler’s CancelEventArgs.Cancel parameter to true to block the refresh.

  • BaseObjectSpace.CustomRefresh

    Handle this event to perform a custom refresh operation. Set the handler’s CompletedEventArgs.Handled property to true to show that you already performed the refresh. Set the handler’s CompletedEventArgs.IsCompleted property to the value that the Refresh method returns.

Implements

See Also