ComboBoxEdit
- 2 minutes to read
You can change the operation mode of a combo box editor by using the BaseEdit.StyleSettings property. To apply specific settings, assign the BaseEdit.StyleSettings property of a combo box editor to one of the objects listed in the table below.
Operation Mode | Settings object | Description |
---|---|---|
Simple item list combo box | Standard combo box. This is the default operation mode. | |
Checked combo box | Checked item list. Allows multiple item selection. | |
Radio button combo box | A list with radio buttons next to the items. Allows single item selection. | |
Token combo box | Item list that allows multiple item selection. Selected items are represented by tokens. | |
Checked token combo box | Checked item list. Allows multiple item selection. Selected items are represented by tokens. |
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.
<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>