The requested page is not available for the requested platform. You are viewing the content for Default platform.

View.CurrentObjectChanged Event

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

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v19.1.dll


public event EventHandler CurrentObjectChanged
Public Event CurrentObjectChanged As EventHandler

Event Data

The CurrentObjectChanged event handler receives an argument of the EventArgs type.


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