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(IModelMemberViewItem, ViewEditMode) Method

Provides access to the ComplexWebListEditor‘s Property Editor, corresponding to the specified Application Model‘s node.

Namespace: DevExpress.ExpressApp.Web.Editors

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

NuGet Package: DevExpress.ExpressApp.Web

Declaration

public WebPropertyEditor FindPropertyEditor(
    IModelMemberViewItem modelViewItem,
    ViewEditMode viewEditMode
)

Parameters

Name Type Description
modelViewItem IModelMemberViewItem

An IModelMemberViewItem object, representing the Application Model’s node, corresponding to the required Property Editor.

viewEditMode ViewEditMode

A ViewEditMode enumeration value that specify the display mode.

Returns

Type Description
WebPropertyEditor

A WebPropertyEditor, corresponding to the specified Application Model’s node.

Remarks

The FindPropertyEditor method returns the specified column’s Property Editor. This Property Editor uses the IModelColumn settings when it instantiates the columnn’s cell controls. You can cusotmize this Property Editor and handle its events to change the grid cells’ appearance and behavior. The Property Editor’s settings can be used differently in different ComplexWebListEditor descendants.

In ASPxGridListEditor, this method applies to the following tasks:

To customize ASPxGridListEditor cell settings in other cases, use standard ASPxGridView approaches - for example, change the GridViewEditDataColumn.PropertiesEdit settings.

The ViewController below accesses and changes an Edit mode inline editor (LastName) in the Contact List View. This code snippet demonstrates the first approach from the list above.

using System;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Editors;
using DevExpress.ExpressApp.Web.Editors.ASPx;

public class MyViewController : ObjectViewController<ListView, Contact> {
    ASPxStringPropertyEditor lastNameEditor;
    protected override void OnViewControlsCreated() {
        base.OnViewControlsCreated();
        if (lastNameEditor == null) {
            ASPxGridListEditor gridListEditor = View.Editor as ASPxGridListEditor;
            if (gridListEditor != null) {
                lastNameEditor = gridListEditor.FindPropertyEditor("LastName", ViewEditMode.Edit) as ASPxStringPropertyEditor;
                if (lastNameEditor != null) {
                    lastNameEditor.ControlCreated += lastNameEditor_ControlCreated;
                }
            }
        }
    }
    void lastNameEditor_ControlCreated(object sender, EventArgs e) {
        ASPxStringPropertyEditor lastNameEditor = (ASPxStringPropertyEditor)sender;
        if (lastNameEditor.Editor != null) {
            lastNameEditor.Editor.SelectInputTextOnClick = true;
        }
    }
    protected override void OnDeactivated() {
        base.OnDeactivated();
        if (lastNameEditor != null) {
            lastNameEditor.ControlCreated -= lastNameEditor_ControlCreated;
            lastNameEditor = null;
        }
    }
}
See Also