Tab

ListBoxProperties.SelectionMode Property

Gets or sets a value that specifies item selection behavior.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

[DefaultValue(ListEditSelectionMode.Single)]
public ListEditSelectionMode SelectionMode { get; set; }
<DefaultValue(ListEditSelectionMode.Single)>
Public Property SelectionMode As ListEditSelectionMode

Property Value

Type Default Description
ListEditSelectionMode

Single

One of the ListEditSelectionMode enumeration values.

Remarks

The SelectionMode property specifies how many list box items can be selected at once.

The following table provides detailed information about available selection modes:

Selection Mode

Description

Single

(the ListEditSelectionMode.Single value)

Only one list box item can be selected at once.

Multiple

(the ListEditSelectionMode.Multiple value)

Multiple items can be selected within the editor by clicking list items while pressing Ctrl (to add an individual item) or Shift (to select a range of items).

Checkbox

(the ListEditSelectionMode.CheckColumn value)

Multiple items can be selected within the editor by clicking specific check boxes or list items (the Shift key can also be used in this mode to select a range of items).

NOTE

Note that in multiple selection mode, all list items are always sent to the client, and loading items on demand via callbacks is not supported. So, setting the editor's ListBoxProperties.EnableCallbackMode and ListBoxProperties.CallbackPageSize properties is not in effect.

For more information about multiple selection, read the Multi-Selection Mode topic.

NOTE

The SelectionMode property synchronizes its value with the editor's ASPxListBox.SelectionMode property.

Examples

This part of the Multiple Selection demo illustrates how to use multi-selection mode for the ASPxListBox editor.

 ...
     protected void lbModels_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e) {
         FilterModels(lbFeatures.Items);
         lbModels.DataBind();
     }
     protected void FilterModels(ListEditItemCollection items) {
     ...     
     }
...

Implements

DevExpress.Web.Internal.IListBoxRenderHelperOwner.SelectionMode
See Also