Back to Devexpress

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

wpf-devexpress-dot-xpf-dot-editors-dot-lookupeditbase-dot-setupcomboboxenumitemsource-2-x28-devexpress-dot-xpf-dot-editors-dot-lookupeditbase-x29.md

latest2.5 KB
Original Source

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

Binds the enumeration to the specified combo box editor.

Namespace : DevExpress.Xpf.Editors

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public static void SetupComboBoxEnumItemSource<T, DataType>(
    LookUpEditBase comboBox
)
vb
Public Shared Sub SetupComboBoxEnumItemSource(Of T, DataType)(
    comboBox As LookUpEditBase
)

Parameters

NameTypeDescription
comboBoxLookUpEditBase

A LookUpEditBase descendant that represents the combo box editor.

|

Type Parameters

NameDescription
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 :

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

See Also

LookUpEditBase Class

LookUpEditBase Members

DevExpress.Xpf.Editors Namespace