ComboBoxEdit

  • 2 min 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

ComboBoxStyleSettings

Standard combo box. This is the default operation mode.

ComboBoxEditStyleSettingsDefault

Checked combo box

CheckedComboBoxStyleSettings

Checked item list. Allows multiple item selection.

ComboBoxEditStyleSettingsChecked

Radio button combo box

RadioComboBoxStyleSettings

A list with radio buttons next to the items. Allows single item selection.

ComboBoxEditStyleSettingsRadio

Token combo box

TokenComboBoxStyleSettings

Item list that allows multiple item selection. Selected items are represented by tokens.

ComboBoxEditStyleSettingsToken

Checked token combo box

CheckedTokenComboBoxStyleSettings

Checked item list. Allows multiple item selection. Selected items are represented by tokens.

ComboBoxEditStyleSettingsCheckedToken

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>
See Also