BaseListBoxControl.SelectedItem Property
Gets or sets the currently selected item.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v26.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
Property Value
| Type | Description |
|---|---|
| Object | An object representing the list box control’s currently selected item. |
Remarks
If single selection mode is applied to the list box control (the BaseListBoxControl.SelectionMode property value is set to SelectionMode.One), this property contains the currently selected item. Otherwise, when the control works in a multi-selection mode (the BaseListBoxControl.SelectionMode property is set to SelectionMode.MultiSimple or SelectionMode.MultiExtended), this property value represents the top selected item in the list box control.
If you want to obtain the index of an item currently selected, use the BaseListBoxControl.SelectedIndex property. In addition, you can use the BaseListBoxControl.SelectedValue property to obtain the its value.
Changing the SelectedItem property value at runtime raises the BaseListBoxControl.SelectedIndexChanged and BaseListBoxControl.SelectedValueChanged events.