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
 End-User Documentation

Enumeration Properties

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

WinForms and ASP.NET

  • 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 using the ImageNameAttribute attribute).

You can also display an integer property as an enumeration.

Mobile

  • In Edit mode, a lookup widget with the text entries. You can associate custom texts with enumeration values using the XafDisplayNameAttribute attribute.
  • In View mode, a text and image entries (when images are associated with the enumeration values using the ImageNameAttribute attribute).

Note

Refer to the Property Editors | Enum Properties section in the Feature Center demo installed with XAF to see Enumeration Property Editors in action. 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.

  • EnumPropertyEditor

    Control: EnumEdit - a descendant of the XtraEditors Library's ImageComboBoxEdit editor.

    Repository Item: RepositoryItemEnumEdit - a descendant of the XtraEditors Library's RepositoryItemButtonEdit item.

    Description:

    Used for enumeration type properties by default.

    You can specify images for combo box items. This Property Editor uses the EnumDescriptor class to get images and localized item captions. Refer to the How to: Set Images and Captions for Enumeration Values topic for details.

    Use Alt + Down Arrow to expand the EnumEdit's drop-down window.

  • EnumIntPropertyEditor<TEnum>

    Control: EnumIntEdit - a descendant of the XtraEditors Library's ImageComboBoxEdit editor.

    Repository Item: RepositoryItemEnumIntEdit - a descendant of the XtraEditors Library's RepositoryItemImageComboBox item.

    Description:

    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 BOModel | <Class> | OwnMembers | <Member> node's IModelCommonMemberViewItem.PropertyEditorType property in the Model Editor. Instead, inherit this Property Editor and set the TEnum generic parameter to the enumeration type that is mapped to the current integer property. Then, you can set this Property Editor type for the PropertyEditorType property. Refer to the How to: Display an Integer Property as an Enumeration topic for more information.

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.

  • ASPxEnumPropertyEditor

    View mode control: System.Web.UI.WebControls.Label.

    Edit mode control: the ASPxEditors Library's ASPxComboBox editor.

    Description:

    Used for enumeration type properties by default.

    You can specify images for combo box items. Refer to the How to: Set Images and Captions for Enumeration Values topic for more details. This Property Editor uses the EnumDescriptor class to get images and localized item captions.

    Use Alt + Down Arrow to expand the editor's drop-down window.

  • ASPxEnumIntPropertyEditor<TEnum>

    View mode: System.Web.UI.WebControls.Label.

    Edit mode: the ASPxEditors Library's ASPxComboBox editor.

    Description:

    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 is mapped to the current integer property. Then, you can set this Property Editor type for the PropertyEditorType property. Refer to the How to: Display an Integer Property as an Enumeration topic.

Expanded Mobile Property Editors for Enumeration Properties

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

MobileEnumPropertyEditor

View mode widget:

Edit mode widget: dxLookup.

Description:

Used for enumeration type properties by default.

You can specify images for lookup items, but they are displayed only in View mode. This Property Editor uses the EnumDescriptor class to get localized item captions.

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