.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

View.CurrentObjectChanged Event

Occurs after changing a View’s focused object (not an object’s property value).

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v21.1.dll


public event EventHandler CurrentObjectChanged

Event Data

The CurrentObjectChanged event's data class is EventArgs.


This event is raised in methods of the View class descendants:


Do not mix a View’s focused object changes with property value changes. To track object instance’s changes, handle the IObjectSpace.ObjectChanged, INotifyPropertyChanged.PropertyChanged or other suitable events.

The following example demonstrates how to use the CurrentObjectChanged event to make a View read-only:

public class MyController : ViewController {
    protected override void OnActivated() {
        View.CurrentObjectChanged += View_CurrentObjectChanged;
        View_CurrentObjectChanged(View, new EventArgs());
    private void View_CurrentObjectChanged(object sender, EventArgs e) {
       if (View.CurrentObject is Task) {
            View.AllowEdit["CurrentUser"] = ((Task)View.CurrentObject).Owner.Id == SecuritySystem.CurrentUserId;
    protected override void OnDeactivated() {           
        View.CurrentObjectChanged -= View_CurrentObjectChanged;
See Also