Skip to main content
.NET Framework 4.5.2+
  • The page you are viewing does not exist in the .NET 6.0+ platform documentation. This link will take you to the parent topic of the current section.

ComplexWebListEditor.FindPropertyEditor(String, ViewEditMode) Method

Provides access to the ComplexWebListEditor‘s Property Editor, representing a particular property.

Namespace: DevExpress.ExpressApp.Web.Editors

Assembly: DevExpress.ExpressApp.Web.v23.2.dll

NuGet Package: DevExpress.ExpressApp.Web

Declaration

public WebPropertyEditor FindPropertyEditor(
    string propertyName,
    ViewEditMode viewEditMode
)

Parameters

Name Type Description
propertyName String

A string holding the name of the required property.

viewEditMode ViewEditMode

A ViewEditMode enumeration value that specify the display mode.

Returns

Type Description
WebPropertyEditor

A WebPropertyEditor representing the specified property.

Remarks

To create inline templates used to display grid cells, the ComplexWebListEditor instantiates appropriate Property Editors, using the information from the Application Model. The FindPropertyEditor method allows you to customize the actual controls representing grid cells, by customizing these Property Editors. The following code snippet illustrates this. The MyViewController designed for Contact List Views, changes the display color of the LastName property to purple.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Editors;
using DevExpress.ExpressApp.Model;
using DevExpress.ExpressApp.Web.Editors;

public class MyViewController : ObjectViewController<ListView, Contact> {
    WebPropertyEditor lastNamePropertyEditor;
    protected override void OnViewControlsCreated() {
        base.OnViewControlsCreated();
        if (View.Editor is ComplexWebListEditor) {
            IModelMemberViewItem lastName = View.Model.Columns["LastName"];
            lastNamePropertyEditor = ((ComplexWebListEditor)View.Editor).FindPropertyEditor(lastName, ViewEditMode.View);
            lastNamePropertyEditor.ControlCreated += MyViewController_ControlCreated;
        }
    }
    void MyViewController_ControlCreated(object sender, EventArgs e) {
        ((WebPropertyEditor)sender).InplaceViewModeEditor.ForeColor = Color.Purple;
    }
    protected override void OnDeactivated() {
        base.OnDeactivated();
        if (lastNamePropertyEditor != null) {
            lastNamePropertyEditor.ControlCreated -= MyViewController_ControlCreated;
            lastNamePropertyEditor = null;
        }
    }
}
See Also