ListBoxEdit
- 2 minutes to read
Overview
The ListBoxEdit is a control that allows end-users to select items from a list. The ListBoxEdit control supports multiple operation modes.
The ListBoxEdit control offers the following features.
Multiple operation modes
The ListBoxEdit control supports the following operation modes.
- Simple item list
- Checked list box
- Radio button list box
Optional item highlighting
Use the ListBoxEdit.AllowItemHighlighting property to control the highlighting behavior.
Multiple items selection
Use the ListBoxEdit.SelectionMode property to switch between Multiple and Single selection modes.
Optimized for in-place editing
ListBoxEdit can be used standalone or as an in-place editor nested in a container control. The ListBoxEditSettings class implements the in-place editing functionality. See In-place Editors to learn more.
Tip
Set the ListBoxEdit.ShowCustomItems property to false to avoid displaying the (Select All) custom item in the Checked List Box mode.
Standalone ListBoxEdit
To add a standalone ListBoxEdit to a Window, drag it from the Toolbox.
The following sample demonstrates how to create a ListBoxEdit using XAML markup.
<dxe:ListBoxEdit>
<dxe:ListBoxEdit.StyleSettings>
<dxe:CheckedListBoxEditStyleSettings/>
</dxe:ListBoxEdit.StyleSettings>
<dxe:ListBoxEdit.Items>
<dxe:ListBoxEditItem>
Item1
</dxe:ListBoxEditItem>
<dxe:ListBoxEditItem>
Item2
</dxe:ListBoxEditItem>
<dxe:ListBoxEditItem>
Item3
</dxe:ListBoxEditItem>
</dxe:ListBoxEdit.Items>
</dxe:ListBoxEdit>
In-place ListBoxEdit
To embed a ListBoxEdit into a container control, use the ListBoxEditSettings class.
The following sample demonstrates how to embed a ListBoxEdit into a GridControl column.
<dxg:GridControl>
<dxg:GridColumn Header="Dimensions">
<dxg:GridColumn.EditSettings>
<dxe:ListBoxEditSettings>
<dxe:ListBoxEditSettings.Items>
<dxe:ListBoxEditItem>1x1</dxe:ListBoxEditItem>
<dxe:ListBoxEditItem>1x2</dxe:ListBoxEditItem>
<dxe:ListBoxEditItem>2x2</dxe:ListBoxEditItem>
<dxe:ListBoxEditItem>3x3</dxe:ListBoxEditItem>
<dxe:ListBoxEditItem>3x4</dxe:ListBoxEditItem>
<dxe:ListBoxEditItem>4x4</dxe:ListBoxEditItem>
</dxe:ListBoxEditSettings.Items>
<dxe:ListBoxEditSettings.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Height="60" Orientation="Vertical" />
</ItemsPanelTemplate>
</dxe:ListBoxEditSettings.ItemsPanel>
<dxe:ListBoxEditSettings.StyleSettings>
<dxe:RadioListBoxEditStyleSettings />
</dxe:ListBoxEditSettings.StyleSettings>
</dxe:ListBoxEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridControl.View>
<dxg:TableView/>
</dxg:GridControl.View>
</dxg:GridControl>