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.v24.2.dll
NuGet Package: DevExpress.ExpressApp.Web
#Declaration
public WebPropertyEditor FindPropertyEditor(
string propertyName,
ViewEditMode viewEditMode
)
#Parameters
Name | Type | Description |
---|---|---|
property |
String | A string holding the name of the required property. |
view |
View |
A View |
#Returns
Type | Description |
---|---|
Web |
A Web |
#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;
}
}
}