ListBoxEdit.SelectionMode Property

Gets or sets how list items are selected. This is a dependency property.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v20.1.dll

Declaration

public SelectionMode SelectionMode { get; set; }
Public Property SelectionMode As SelectionMode

Property Value

Type Description
SelectionMode

A SelectionMode enumeration value that specifies the editor's selection behavior.

Remarks

Use the SelectionMode property to specify how many items a user can select at once, and the ways the user can perform multiple selections. By default, the list box editor functions in single selection mode - items can only be selected one at a time.

listBox_SelectedItems

Setting the SelectionMode property to Extended, enables multiple item selection. An end user can select a continuous range of items by clicking them (or using the UP ARROW, DOWN ARROW, PgUp or PgDn) while holding the SHIFT key down. This extends the selection from the previously selected to the current item. Pressing CTRL and clicking the mouse toggles an item's selected state.

NOTE

The editor's EditValue property returns a List<T><Object,> of selected items when multiple items are selected. This List<T><Object,> is recreated each time the selection is changed. Changing the collection of items returned by the EditValue property does not affect the actual set of selected items.

Use the ListBoxEdit.SelectedItems property to edit a collection of selected items in code.

If the SelectionMode property is set to Multiple, a mouse click or pressing the SPACEBAR selects or deselects an item in the list.

Each time the selection changes, the ListBoxEdit.SelectedIndexChanged event is fired.

NOTE

If the ListBoxEdit represents a checked list, the SelectionMode property is set to Multiple and cannot be changed.

If the ListBoxEdit represents a radio list, the SelectionMode property is set to Single and cannot be changed.

Implements

DevExpress.Xpf.Editors.Internal.ISelectorEdit.SelectionMode
See Also