Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

LookUpEditBase.SetupComboBoxEnumItemSource<T, DataType>(LookUpEditBase) Method

Binds the enumeration to the specified combo box editor.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v24.2.dll

NuGet Package: DevExpress.Wpf.Core

#Declaration

public static void SetupComboBoxEnumItemSource<T, DataType>(
    LookUpEditBase comboBox
)

#Parameters

Name Type Description
comboBox LookUpEditBase

A LookUpEditBase descendant that represents the combo box editor.

#Type Parameters

Name Description
T

An enumeration type, whose members represent the combo box items. If the specified object doesn’t represent the enumeration, an exception is thrown.

DataType

A type to which the enumeration members must be cast to get their values.

#Remarks

T - an enumeration type, whose members represent the combo box items. If the specified object doesn’t represent the enumeration, an exception is thrown.

DataType - a type to which the enumeration members should be cast to get their values.

The SetupComboBoxEnumItemSource<T, DataType> method creates the list of items from the specified enumeration and assigns it to the LookUpEditBase.ItemsSource property. The LookUpEditBase.DisplayMember property is set to ‘Text’. The LookUpEditBase.ValueMember property is set to ‘Value’.

Example:

ComboBoxEdit.SetupComboBoxEnumItemSource<HorizontalAlignment, int>(dxCombo);
See Also