Public Enum Foods
Fruits
Vegetables
Meat
Dairy
Bread
Eggs
End Enum
We recommend that you use the xamComboEditor control instead of the xamComboEditor (Input) control. The xamComboEditor (Input) is being planned for retirement over the next few years and will not receive any new features. We will continue to provide support and critical bug fixes for the xamComboEditor (Input) during this time. For help or questions on migrating your codebase to the xamComboEditor, please contact support.
This topic explains the behavior of the control when bound to an enum data type.
The following topic is prerequisites to understanding this topic:
When the xamComboEditor control has both its ItemsSource and ItemsProvider properties not set and the ValueType property set to an enum (or a nullable enum) type then an internal items provider is created and populates the dropdown with the values obtained from the enum type.
The enum values are extracted in the following manner:
it obtains a type converter with a call to TypeDescriptor.GetConverter(valueType)
it then enumerates over the converter’s GetStandardValues()
collection which also determines the order of the values in the dropdown
The null value of a nullable enum is handled in the following way: if the converter converts the null to a non-empty string it will be used as the display value, otherwise a localized string with a key of Nullable_Enum_NullValue_Literal
(which for English is "[null]") will be used. This resource is in the Editors assembly.
There are ways to exclude certain properties from the dropdown, change their display value or even change the order they are shown in the dropdown. All these features are described in the table below.
The following table explains briefly the configurable aspects of the enum handling feature of the xamComboEditor control.
The following topics provide additional information related to this topic.