EnumPropertyEditor. Getting Started

In this topic, you will learn how to use the XafariEnumPropertyEditor. We will use an example from the Feature Center demo. We will set the Property Editor to display EnumPropertyEditorObject type objects. Follow the steps described below.

  • Open the existing XAF solution and navigate to the Module Project.
  • Add enumerations MyDaysOfWeek and MyMonthes with Flags Attribute and enumeration Subject to the Module Project. Use the following code:
  • Implement the EnumPropertyEditorObject business class, which exposes MyDaysOfWeek type, MyMonthes type, and Subject type properties. Use the following code snippet:
  • Add XafariModule and XafariEditorsModule to the Module Project.
  • Add XafariWebModule and XafariEditorsWebModule to the ASP.NET Web Module Project.
  • Add XafariWinModule and XafariEditorsWinModule to the Windows Forms Application Project.
  • Invoke the Model Editor. Navigate to the BOModel|Xafari.FeatureCenter.Editors|EnumPropertyEditorObject|OwnMembers node and set the PropertyEditorType property to "Xafari.Editors.Win.WinEnumPropertyEditor" ("Xafari.Editors.Web.ASPxXafariEnumPropertyEditor" for the ASP.NET application). Set the same value for the Month and Subject nodes.  The Day node is shown in the figure below.

enum_property_editor_2

  • Navigate to the Views|Xafari.FeatureCenter.Editors|EnumPropertyEditorObject_DetailView|Items|Day node and set the EnumViewType property to the "CheckedListBox", as shown in the figure below.        

enum_property_editor_3

  • Navigate to the Month item and set the EnumViewType property to the "CheckedComboBox"; set the ColumnsCount property to 2.
  • Run the application (whether Windows Forms or ASP.NET) and select the EnumPropertyEditorObject item in the navigation control.

ASP.NET:

enum_property_editor_4