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
 [Collapse]Concepts
  [Expand]Application Solution Components
  [Collapse]Business Model Design
    Business Model Design Basics
    Built-in Business Classes for Most Popular Scenarios
   [Expand]Business Model Design with Entity Framework
   [Expand]Business Model Design with XPO
    Non-Persistent Objects
    PropertyChanged Event in Business Classes
   [Collapse]Data Types Supported by built-in Editors
     Key Properties
    [Expand]String Properties
    [Expand]Numeric Properties
    [Expand]Date and Time Properties
    [Expand]Boolean Properties
    [Expand]BLOB Image Properties
    [Expand]Collection Properties
    [Expand]Reference (Foreign Key, Complex Type) Properties
    [Expand]File Attachment Properties
    [Expand]Type Properties
    [Collapse]Enumeration Properties
      Enumeration Properties in XPO
      Enumeration Properties in Entity Framework
      Enumeration Properties in Domain Components
    [Expand]Criteria Properties
    [Expand]Color Properties
     Geolocation Properties
     Miscellaneous Property Types
    Mapping Complex Types to the Database
   [Expand]Types Info Subsystem
    Connect an XAF Application to a Database Provider
    Data Annotations in Data Model
    Create and Update the Application's Database
  [Expand]Application Model
  [Expand]UI Construction
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
[Expand]End-User Documentation

Enumeration Properties

In XAF, enumeration properties can be displayed in the following manner.

  • A combo box with text entries (default). You can associate custom texts with enumeration values using the XafDisplayNameAttribute attribute.
  • A combo box with text and image entries (when images are associated with the enumeration values via the ImageNameAttribute attribute).

In addition, you can display an integer property as an enumeration.

WinForms

ASP.NET

Note

To see Enumeration Property Editors in action, refer to the Property Editors | Enum Properties section in the Feature Center demo installed with XAF. By default, the Feature Center demo is installed in %PUBLIC%\Documents\DevExpress Demos 17.1\Components\eXpressApp Framework\FeatureCenter. The ASP.NET version of this demo is available online at http://demos.devexpress.com/XAF/FeatureCenter/.

Expanded Examples

Expanded WinForms Property Editors for Enumeration Properties

Each WinForms Property Editor has a control that displays a corresponding property in a Detail View, and a repository item that displays a property in a List Editor that supports in-place editing. The table below shows both the control and repository item.

Property Editor Type and Description Control Repository Item

EnumPropertyEditor

Used for enumeration type properties by default.
You can specify images for combo box items. For details, refer to the How to: Set Images and Captions for Enumeration Values topic. This Property Editor uses the EnumDescriptor class to get images and localized item captions.
To expand the EnumEdit's drop-down window, use Alt + Down Arrow.
EnumEdit - a descendant of the ImageComboBoxEdit editor from the XtraEditors Library RepositoryItemEnumEdit - a descendant of the RepositoryItemButtonEdit repository item from the XtraEditors Library

EnumIntPropertyEditor<TEnum>

The base class for custom WinForms Property Editors, intended to display integer properties as enumerations.
Note that you cannot directly assign this Property Editor type to the IModelCommonMemberViewItem.PropertyEditorType property of the BOModel | <Class> | OwnMembers | <Member> node in the Model Editor. Instead, inherit this Property Editor and set the TEnum generic parameter to the enumeration type that will be mapped to the current integer property. Then, you can set this Property Editor type for the PropertyEditorType property. For details, refer to the How to: Display an Integer Property as an Enumeration topic.
EnumIntEdit - a descendant of the ImageComboBoxEdit editor from the XtraEditors Library RepositoryItemEnumIntEdit - a descendant of the RepositoryItemImageComboBox repository item from the XtraEditors Library

Expanded ASP.NET Property Editors for Enumeration Properties

Each ASP.NET Property Editor has controls that display a property in a Detail View's View mode and in an Edit mode (see DetailView.ViewEditMode). These controls are listed in the table below.

Property Editor Type and Description

Control Used in View Mode

Control Used in Edit Mode

ASPxEnumPropertyEditor

Used for enumeration type properties by default.
You can specify images for combo box items. For details, refer to the How to: Set Images and Captions for Enumeration Values topic. This Property Editor uses the EnumDescriptor class to get images and localized item captions.
To expand the editor's drop-down window, use Alt + Down Arrow.
System.Web.UI.WebControls.Label ASPxComboBox editor from the ASPxEditors Library

ASPxEnumIntPropertyEditor<TEnum>

The base class for custom ASP.NET Property Editors, intended to display integer properties as enumerations.
Note that you cannot directly assign this Property Editor type to the IModelCommonMemberViewItem.PropertyEditorType property of the BOModel | <Class> | OwnMembers | <Member> node in the Model Editor. Instead, inherit this Property Editor and set the TEnum generic parameter to the enumeration type that will be mapped to the current integer property. Then, you can set this Property Editor type for the PropertyEditorType property. For details, refer to the How to: Display an Integer Property as an Enumeration topic.
System.Web.UI.WebControls.Label ASPxComboBox editor from the ASPxEditors Library

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