ListBox::SelectionMode Property
.NET Framework (current version)
Gets or sets the selection mode of the ListBox control.
Assembly: System.Web (in System.Web.dll)
public: property ListSelectionMode SelectionMode { virtual ListSelectionMode get(); virtual void set(ListSelectionMode value); }
Property Value
Type: System.Web.UI.WebControls::ListSelectionModeOne of the ListSelectionMode values. The default value is Single.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | The specified selection mode is not one of the ListSelectionMode values. |
Use the SelectionMode property to specify the mode behavior of the ListBox control. Setting this property to ListSelectionMode.Single indicates only a single item can be selected from the ListBox control, while ListSelectionMode.Multiple specifies multiple items can be selected.
The value of the SelectionMode property is stored in view state.
.NET Framework
Available since 1.1
Available since 1.1
Show: