Skip to main content
.NET 8.0+

ListView.EditViewCreated Event

Occurs after the ListView.EditView has been created.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public event EventHandler<DetailViewCreatedEventArgs> EditViewCreated

Event Data

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

Property Description
View Specifies the Detail View to be customized in the XafApplication.DetailViewCreated event.

Remarks

Handle this event to access the Detail View displayed together with a List View.

The following example demonstrates how to make the Department Detail View in MasterDetailMode read-only:

using System;
using DevExpress.ExpressApp;
// ...
public class AllowNewViewController : ViewController<ListView> {
    protected override void OnActivated() {
        base.OnActivated();
        if(View.Model.MasterDetailMode == MasterDetailMode.ListViewAndDetailView) {
            if(View.EditView != null) {
                SetAllowEdit(View.EditView);
            }
            View.EditViewCreated += new EventHandler<DetailViewCreatedEventArgs>(AllowNewViewController_EditViewCreated);
        }
    }
    private void AllowNewViewController_EditViewCreated(object sender, DetailViewCreatedEventArgs e) {
        SetAllowEdit(e.View);
    }
    private void SetAllowEdit(DetailView editView) {
        editView.AllowEdit.SetItemValue("ByObjectType", View.ObjectTypeInfo.Type != typeof(Department));
    }
    protected override void OnDeactivated() {
        base.OnDeactivated();
        View.EditViewCreated -= AllowNewViewController_EditViewCreated;
    }
}
See Also