Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
 [Expand]Frequently Asked Questions
 [Collapse]API Reference
  [Expand]DevExpress.EasyTest.Framework
  [Expand]DevExpress.ExpressApp
  [Expand]DevExpress.ExpressApp.Actions
  [Expand]DevExpress.ExpressApp.AuditTrail
  [Expand]DevExpress.ExpressApp.Chart
  [Expand]DevExpress.ExpressApp.Chart.Web
  [Expand]DevExpress.ExpressApp.Chart.Win
  [Expand]DevExpress.ExpressApp.CloneObject
  [Expand]DevExpress.ExpressApp.ConditionalAppearance
  [Expand]DevExpress.ExpressApp.Dashboards
  [Expand]DevExpress.ExpressApp.Dashboards.Web
  [Expand]DevExpress.ExpressApp.Dashboards.Win
  [Expand]DevExpress.ExpressApp.Data
  [Expand]DevExpress.ExpressApp.DC
  [Expand]DevExpress.ExpressApp.DC.ClassGeneration
  [Collapse]DevExpress.ExpressApp.Editors
   [Expand]ActionContainerViewItem Class
   [Expand]ColumnsListEditor Class
   [Expand]CreateCustomModelSynchronizerEventArgs Class
   [Expand]CriteriaObjectTypeMemberAttribute Class
   [Expand]CriteriaOptionsAttribute Class
   [Expand]DashboardViewItem Class
    EditMaskType Enumeration
   [Expand]EditorAliases Structure
   [Expand]EditorDescriptorsFactory Class
   [Expand]IAppearanceEnabled Interface
   [Expand]IAppearanceFormat Interface
   [Expand]IAppearanceVisibility Interface
   [Expand]IComplexControl Interface
   [Expand]IComplexListEditor Interface
   [Expand]IComplexViewItem Interface
   [Expand]IModelRegisteredPropertyEditor Interface
   [Expand]IModelRegisteredPropertyEditors Interface
   [Expand]IModelRegisteredViewItem Interface
   [Expand]IModelRegisteredViewItems Interface
   [Expand]INotifyAppearanceVisibilityChanged Interface
   [Expand]ListEditor Class
   [Expand]ListEditorAttribute Class
   [Expand]ModelRegisteredViewItemsGenerator Class
   [Collapse]PropertyEditor Class
     PropertyEditor Members
    [Expand]PropertyEditor Properties
    [Expand]PropertyEditor Events
    [Expand]PropertyEditor Methods
   [Expand]PropertyEditorAttribute Class
    StaticHorizontalAlign Enumeration
   [Expand]StaticImage Class
   [Expand]StaticText Class
    StaticVerticalAlign Enumeration
    ViewEditMode Enumeration
   [Expand]ViewItem Class
   [Expand]ViewItemAttribute Class
    ViewItemVisibility Enumeration
  [Expand]DevExpress.ExpressApp.EF
  [Expand]DevExpress.ExpressApp.EF.Utils
  [Expand]DevExpress.ExpressApp.FileAttachments.Web
  [Expand]DevExpress.ExpressApp.FileAttachments.Win
  [Expand]DevExpress.ExpressApp.Filtering
  [Expand]DevExpress.ExpressApp.HtmlPropertyEditor.Web
  [Expand]DevExpress.ExpressApp.HtmlPropertyEditor.Win
  [Expand]DevExpress.ExpressApp.Kpi
  [Expand]DevExpress.ExpressApp.Layout
  [Expand]DevExpress.ExpressApp.Maps.Mobile
  [Expand]DevExpress.ExpressApp.Maps.Mobile.Editors
  [Expand]DevExpress.ExpressApp.Maps.Web
  [Expand]DevExpress.ExpressApp.Maps.Web.Helpers
  [Expand]DevExpress.ExpressApp.MiddleTier
  [Expand]DevExpress.ExpressApp.Mobile
  [Expand]DevExpress.ExpressApp.Mobile.Editors
  [Expand]DevExpress.ExpressApp.Mobile.MobileModel
  [Expand]DevExpress.ExpressApp.Mobile.SystemModule
  [Expand]DevExpress.ExpressApp.Model
  [Expand]DevExpress.ExpressApp.Model.Core
  [Expand]DevExpress.ExpressApp.Model.NodeGenerators
  [Expand]DevExpress.ExpressApp.ModelEditor
  [Expand]DevExpress.ExpressApp.Notifications
  [Expand]DevExpress.ExpressApp.Notifications.Web
  [Expand]DevExpress.ExpressApp.Notifications.Win
  [Expand]DevExpress.ExpressApp.PivotChart
  [Expand]DevExpress.ExpressApp.PivotChart.Web
  [Expand]DevExpress.ExpressApp.PivotChart.Win
  [Expand]DevExpress.ExpressApp.PivotGrid
  [Expand]DevExpress.ExpressApp.PivotGrid.Web
  [Expand]DevExpress.ExpressApp.PivotGrid.Win
  [Expand]DevExpress.ExpressApp.Reports
  [Expand]DevExpress.ExpressApp.Reports.Web
  [Expand]DevExpress.ExpressApp.Reports.Win
  [Expand]DevExpress.ExpressApp.ReportsV2
  [Expand]DevExpress.ExpressApp.ReportsV2.Web
  [Expand]DevExpress.ExpressApp.ReportsV2.Win
  [Expand]DevExpress.ExpressApp.Scheduler
  [Expand]DevExpress.ExpressApp.Scheduler.Web
  [Expand]DevExpress.ExpressApp.Scheduler.Win
  [Expand]DevExpress.ExpressApp.ScriptRecorder
  [Expand]DevExpress.ExpressApp.ScriptRecorder.Web
  [Expand]DevExpress.ExpressApp.ScriptRecorder.Win
  [Expand]DevExpress.ExpressApp.Security
  [Expand]DevExpress.ExpressApp.Security.Adapters
  [Expand]DevExpress.ExpressApp.Security.ClientServer.Wcf
  [Expand]DevExpress.ExpressApp.Security.EF.Adapters
  [Expand]DevExpress.ExpressApp.Security.Strategy
  [Expand]DevExpress.ExpressApp.Security.Xpo.Adapters
  [Expand]DevExpress.ExpressApp.StateMachine
  [Expand]DevExpress.ExpressApp.SystemModule
  [Expand]DevExpress.ExpressApp.Templates
  [Expand]DevExpress.ExpressApp.Templates.ActionContainers
  [Expand]DevExpress.ExpressApp.TreeListEditors
  [Expand]DevExpress.ExpressApp.TreeListEditors.Web
  [Expand]DevExpress.ExpressApp.TreeListEditors.Win
  [Expand]DevExpress.ExpressApp.Updating
  [Expand]DevExpress.ExpressApp.Utils
  [Expand]DevExpress.ExpressApp.Validation
  [Expand]DevExpress.ExpressApp.Validation.Web
  [Expand]DevExpress.ExpressApp.Validation.Win
  [Expand]DevExpress.ExpressApp.ViewVariantsModule
  [Expand]DevExpress.ExpressApp.Web
  [Expand]DevExpress.ExpressApp.Web.Controls
  [Expand]DevExpress.ExpressApp.Web.Editors
  [Expand]DevExpress.ExpressApp.Web.Editors.ASPx
  [Expand]DevExpress.ExpressApp.Web.SystemModule
  [Expand]DevExpress.ExpressApp.Web.Templates
  [Expand]DevExpress.ExpressApp.Web.Utils
  [Expand]DevExpress.ExpressApp.Win
  [Expand]DevExpress.ExpressApp.Win.Core
  [Expand]DevExpress.ExpressApp.Win.Editors
  [Expand]DevExpress.ExpressApp.Win.Model
  [Expand]DevExpress.ExpressApp.Win.SystemModule
  [Expand]DevExpress.ExpressApp.Win.Templates
  [Expand]DevExpress.ExpressApp.Win.Templates.Navigation
  [Expand]DevExpress.ExpressApp.Workflow
  [Expand]DevExpress.ExpressApp.Workflow.Win
  [Expand]DevExpress.ExpressApp.Xpo
  [Expand]DevExpress.ExpressApp.Xpo.Utils
  [Expand]DevExpress.Persistent.Base
  [Expand]DevExpress.Persistent.Base.General
  [Expand]DevExpress.Persistent.Base.ReportsV2
  [Expand]DevExpress.Persistent.Base.Security
  [Expand]DevExpress.Persistent.BaseImpl
  [Expand]DevExpress.Persistent.BaseImpl.EF
  [Expand]DevExpress.Persistent.BaseImpl.EF.PermissionPolicy
  [Expand]DevExpress.Persistent.BaseImpl.PermissionPolicy
  [Expand]DevExpress.Persistent.Validation
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

PropertyEditor Class

A base class for Property Editors.

Namespace:DevExpress.ExpressApp.Editors
Assembly:DevExpress.ExpressApp.v17.1.dll

Expanded Syntax

Expanded Remarks

A Detail View represents an object through a set of Property Editors, each of which is bound to a property of the object. The eXpressApp Framework ships with numerous Property Editor types, for Windows Forms and ASP.NET applications, and for different data types. The base class for all Property Editor types is the Property Editor type. It provides basic functionality:

The PropertyEditor class and its descendants can be used to implement custom Property Editors. For details, see the Implement Custom Property Editors topic. When deriving from the PropertyEditor class, the following protected members, not described in the documentation, can be overridden:

Member

Description

OnValueStoring Called in the WriteValue method, before the value specified in a Property Editor's control is set for the bound property. Raises the ValueStoring event. Note that the WriteValue method is not called in the built-in Windows Forms Property Editors, because they support Binding (see System.Windows.Forms.Binding in MSDN). If you implement a Property Editor that supports binding, call the OnValueStoring method, where required.
OnValueStored Called in the WriteValue method, after the value specified in a Property Editor's control has been set for the bound property. Raises the ValueStored event. Note that the WriteValue method is not called in the built-in Windows Forms Property Editors, because they support Binding (see System.Windows.Forms.Binding in MSDN). If you implement a Property Editor that supports binding, call the OnValueStored method, where required.
OnControlValueChanged Raises the ControlValueChanged event. However, the OnControlValueChanged method is not called by default. You should call it in your PropertyEditor class' descendants, after the control's value has been changed. For details, refer to the event's description.
WriteValueCore Called in the WriteValue method. Passes the value from the control to the property (from ControlValue to PropertyValue). Override this method to implement custom code. Note that the WriteValue method is not called in the built-in Windows Forms Property Editors, because they support binding (see System.Windows.Forms.Binding in MSDN). So, do not override the WriteValueCore method in descendants of these Property Editors.
OnValueRead Called in the ReadValue method, after the value of the bound property is set for the control's value.
ReadValueCore Called as a result of calling the ReadValue method. Since it is abstract, override it to add the code that passes the value from the property to a control (from PropertyValue to ControlValue).
CanReadValue Returns true if the Property Editor's control is created. Override this method to provide extra conditions to determine whether the property's value can be read to the control's value.
OnAllowEditChanged Called after the Property Editor's read-only state has been changed (see AllowEdit). Raises the AllowEditChanged event.
IsMemberSetterRequired

Returns whether the Property Editor requires a property with a set accessor to allow editing. For most Property Editor types, override this method to return true. However, for certain Property Editors, such as Property Editors that deal with reference properties, this method must return false to allow editing of the referenced object's properties.

GetControlValueCore This method is abstract. Override it to perform the code that gets the value of the Property Editor's control.

A constructor of a custom Property Editor must be implemented in the following manner.

The model parameter is required for the factory that creates all View Items, including Property Editors for a Detail View.

Note

A custom Property Editor should be implemented in a module project and decorated with the PropertyEditorAttribute. In this instance, it will be loaded into the Application Model, which means that you will be able to use it in a UI. Additionally, the module should be UI-specific, because the Property Editor creates a UI-specific control.

Typical implementation of the PropertyEditor class' descendant comprises the following steps:

  1. Override the CreateControlCore method. Create and return an instance of the required control. Subscribe to the control's ValueChanged event to call the WriteValue method.
  2. Override the GetControlValueCore method. Return the value specified by the control.
  3. Override the ReadValueCore method. Assign the Property Editor's PropertyValue to the control's binding property.

The PropertyEditor class exposes the basic Property Editor functionality. When implementing a custom Property Editor, use one of the derived classes.

If you implement a Property Editor, use the PropertyEditorAttribute.

To access a Property Editor of the View for which a Controller is activated, handle the Controller.Activated and ViewItem.ControlCreated events, as demonstrated in the Access Editor Settings tutorial.

The PropertyEditor class implements the IAppearanceVisibility and IAppearanceEnabled interfaces so that the AppearanceController can change the visibility or enabled state of a property to which a conditional appearance rule is applied.

It is recommended to place your control customization code to the SetupControl method when you create custom property editor.

Expanded Inheritance Hierarchy

System.Object
    ViewItem
       PropertyEditor
          DevExpress.ExpressApp.Web.Editors.ASPx.ASPxObjectPropertyEditor
          DevExpress.ExpressApp.Web.Editors.ASPx.ASPxObjectPropertyEditorBase
          ASPxPropertyEditor
          DXPropertyEditor
          MobileMapsPropertyEditor
          DevExpress.ExpressApp.Mobile.Editors.MobileObjectPropertyEditor
          DevExpress.ExpressApp.Mobile.Editors.MobileObjectPropertyEditorBase
          DevExpress.ExpressApp.Mobile.Editors.MobilePropertyEditor
          WebMapsPropertyEditor
          WebPropertyEditor
          WinPropertyEditor

Expanded See Also

How would you rate this topic?​​​​​​​