Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

Enumeration Properties

  • 3 minutes to read

In XAF, a combo box with text entries displays enumeration properties. Use XafDisplayNameAttribute to associate custom text strings with enumeration values. In WinForms and ASP.NET Web Forms applications, you can also apply ImageNameAttribute to add image entries. Additionally, you can display an integer property as an enumeration.

Refer to the following topics for more information on enumeration properties related to your ORM:

WinForms

Each WinForms Property Editor comes with a control that displays a corresponding property in a Detail View and a repository item that displays this property in a List Editor that supports in-place editing.

Enumeration Properties WinForms

Property Editor

Control

Repository Item

Description

EnumPropertyEditor

EnumEdit (an ImageComboBoxEdit descendant).

RepositoryItemEnumEdit (a RepositoryItemButtonEdit descendant).

Used for enumeration type properties. Press Alt + Down Arrow to expand the EnumEdit drop-down window. In this window, you can see items that consist of a caption and image. The Property Editor uses the EnumDescriptor class to get images and localized captions. Refer to the following topic for implementation details: How to: Set Images and Captions for Enumeration Values.

EnumIntPropertyEditor<TEnum>

EnumIntEdit (an ImageComboBoxEdit descendant).

RepositoryItemEnumIntEdit (a RepositoryItemImageComboBox descendant).

Used to display integer properties as enumerations. Refer to the following topic for more information: How to: Display an Integer Property as an Enumeration.

ASP.NET Web Forms

Each ASP.NET Web Forms Property Editor includes controls that display a property in a Detail View in View and Edit mode.

Enumeration Properties ASP.NET Web Forms

Property Editor

Description

ASPxEnumPropertyEditor

Used for enumeration type properties. The View mode uses the System.Web.UI.WebControls.Label class. The Edit mode uses the ASPxComboBox editor for which you can specify images for combo box items. Press Alt + Down Arrow to expand the editor’s drop-down window. The EnumDescriptor class gets images and localized item captions for the Property Editor. Refer to the following topic for implementation details: How to: Set Images and Captions for Enumeration Values.

ASPxEnumIntPropertyEditor<TEnum>

The base class for Property Editors used to display integer properties as enumerations. View mode uses the System.Web.UI.WebControls.Label class. Edit mode uses the ASPxComboBox editor. You cannot directly assign this Property Editor in the Model Editor. Refer to the following topic for more information: How to: Display an Integer Property as an Enumeration.

ASP.NET Core Blazor

In ASP.NET Core Blazor, the ViewItem.Control property returns an IComponentContentHolder descendant. This descendant has the ComponentModel property, which returns an IComponentModel descendant that wraps properties and events of a Blazor Editor.

Enumeration Properties ASP.NET Core Blazor

Property Editor

IComponentContentHolder descendant

IComponentModel descendant

EnumPropertyEditor

DevExpress.ExpressApp.Blazor.Editors.Adapters.DxComboBoxAdapter<TData, TValue>

DxComboBox<TData, TValue>