BaseListBoxControl.SelectedItem Property

Gets or sets the currently selected item.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

[Browsable(false)]
public virtual object SelectedItem { get; set; }
<Browsable(False)>
Public Overridable Property SelectedItem As Object

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.

See Also