Table of Contents

Property SelectedItems

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

SelectedItems

Gets a collection containing the currently selected items in the ListView.

[Browsable(false)]
public IReadOnlyList<ListViewItem> SelectedItems { get; }

Property Value

IReadOnlyList<ListViewItem>

A IReadOnlyList<T> containing the currently selected items in the control.

Remarks

For a multiple-selection ListView, this property returns a collection containing all the items that are selected in the ListView. For a single-selection ListView, this property returns a collection containing a single element containing the index of the only selected item in the ListView.

The ListView class provides a number of ways to reference selected items. Instead of using the SelectedIndices property to obtain the index position of the currently selected item in a single-selection ListView, you can use the SelectedIndex property. If you want to obtain the item that is currently selected in the ListView, instead of the index position of the item, use the SelectedItem property. In addition, you can use the SelectedIndices property to obtain all the selected indexes in a multiple-selection ListView.