The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.
.NET Core 3.0+
The page you are viewing does not exist in the .NET Core 3.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.v19.2.dll

Declaration

public WebPropertyEditor FindPropertyEditor(
    string propertyName,
    ViewEditMode viewEditMode
)
Public Function FindPropertyEditor(
    propertyName As String,
    viewEditMode As ViewEditMode
) As WebPropertyEditor

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 OnActivated() {
        base.OnActivated();
        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