Skip to main content
.NET 6.0+

IObjectSpace.ObjectReloaded Event

Occurs after an object is reloaded from the database.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

event EventHandler<ObjectManipulatingEventArgs> ObjectReloaded

Event Data

The ObjectReloaded event's data class is ObjectManipulatingEventArgs. The following properties provide information specific to this event:

Property Description
Object Provides access to the object that is being manipulated.

Remarks

In the BaseObjectSpace descendant, invoke the BaseObjectSpace.OnObjectReloaded method to raise the ObjectReloaded event.

The following code reloads the parent Detail View when one of the child objects is reloaded.

using DevExpress.ExpressApp;
using YourSolutionName.Module.BusinessObjects;

namespace YourSolutionName.Module.Controllers {
    public class MyViewController : ObjectViewController<DetailView, Parent> {
        protected override void OnActivated() {
            base.OnActivated();
            ObjectSpace.ObjectReloaded += ObjectSpace_ObjectReloaded;
        }
        private void ObjectSpace_ObjectReloaded(object sender, ObjectManipulatingEventArgs e) {
            Child child = e.Object as Child;
            if (child != null && ReferenceEquals(child.Parent, View.CurrentObject)) {
                View.Refresh();
            }
        }
        protected override void OnDeactivated() {
            ObjectSpace.ObjectReloaded -= ObjectSpace_ObjectReloaded;
            base.OnDeactivated();
        }
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ObjectReloaded event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also