ComboBoxEdit Class
Represents an editor that displays a list of items within a dropdown window.
Namespace: DevExpress.Xpf.Editors
Assembly: DevExpress.Xpf.Core.v18.2.dll
Declaration
Related API Members
The following members return ComboBoxEdit objects:
Remarks
The ComboBoxEdit control combines the functionality of a single-line text editor with a dropdown window. The dropdown displays a list of items which can be selected by the end-user. Selecting an item changes the editor’s edit value.
The ComboBoxEdit control holds its items within the ComboBoxEdit.Items collection. The combo box editor can also display items from a data source specified by the LookUpEditBase.ItemsSource (via ComboBoxEdit.ItemsSource) property.
The ComboBoxEdit control supports various operation modes. Use the BaseEdit.StyleSettings property (via ComboBoxEdit.StyleSettings) to specify the required operation mode. The following options are available.
- Standard combo box
- Checked combo box
- Radio button combo box
- Token combo box
- Checked token combo box
To learn more about ComboBoxEdit‘s operation modes, see ComboBoxEdit operation modes.
Example
The following example shows how to apply style settings to the combo box editor.In this example, there are three combo boxes: plain combo box, checked combo box and radio combo box.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-apply-style-settings-to-the-comboboxedit-e1982.
<Window x:Class="ComboBoxEdit_ApplyingStyleSettings.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" Title="Applying Style Settings" Height="140" Width="330">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="164" />
<ColumnDefinition />
<ColumnDefinition Width="44" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="70" />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Grid.Column="1" Grid.Row="1" VerticalAlignment="Center">
<dxe:ComboBoxEdit>
<dxe:ComboBoxEdit.StyleSettings>
<dxe:ComboBoxStyleSettings />
</dxe:ComboBoxEdit.StyleSettings>
<dxe:ComboBoxEditItem Content="Canada" />
<dxe:ComboBoxEditItem Content="Italy" />
<dxe:ComboBoxEditItem Content="USA" />
</dxe:ComboBoxEdit>
<dxe:ComboBoxEdit>
<dxe:ComboBoxEdit.StyleSettings>
<dxe:CheckedComboBoxStyleSettings />
</dxe:ComboBoxEdit.StyleSettings>
<dxe:ComboBoxEditItem Content="Nancy Davolio" />
<dxe:ComboBoxEditItem Content="Andrew Fuller" />
<dxe:ComboBoxEditItem Content="Janet Leverling" />
</dxe:ComboBoxEdit>
<dxe:ComboBoxEdit>
<dxe:ComboBoxEdit.StyleSettings>
<dxe:RadioComboBoxStyleSettings />
</dxe:ComboBoxEdit.StyleSettings>
<dxe:ComboBoxEditItem Content="Seattle" />
<dxe:ComboBoxEditItem Content="London" />
<dxe:ComboBoxEditItem Content="Redmond" />
</dxe:ComboBoxEdit>
</StackPanel>
<Grid Grid.Column="0" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Margin="0,0,5,0" Text="ComboBox Style:" VerticalAlignment="Center" HorizontalAlignment="Right" />
<TextBlock Grid.Row="1" Margin="0,0,5,0" Text="Checked ComboBox Style:" VerticalAlignment="Center" HorizontalAlignment="Right" />
<TextBlock Grid.Row="2" Margin="0,0,5,0" Text="Radio ComboBox Style:" VerticalAlignment="Center" HorizontalAlignment="Right" />
</Grid>
</Grid>
</Window>
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the ComboBoxEdit class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.