ListViewBase.SelectedItems ListViewBase.SelectedItems ListViewBase.SelectedItems ListViewBase.SelectedItems Property

Definition

Gets the currently selected items.

public : IVector<Platform::Object> SelectedItems { get; }
IVector<winrt::Windows::Foundation::IInspectable> SelectedItems();
public IList<object> SelectedItems { get; }
Public ReadOnly Property SelectedItems As IList<object>

Property Value

IList<object> IList<object>

A collection of the currently selected items. The default is an empty collection.

Remarks

When SelectionMode is Multiple or Extended, use the SelectedItems property to get the items that are selected. When SelectionMode is Single, use the Selector.SelectedItem property to get the item that's selected.

Starting in Windows 10, you can use the SelectRange and DeselectRange methods with the SelectedRanges property to make selections using ranges of indexes. This is a more efficient way to describe item selection than using SelectedItems, which requires the actual item object to be created for each selected item.

Note

If the ItemsSource implements IItemsRangeInfo, the SelectedItems collection is not updated based on selection in the list. Use the SelectedRanges property instead.

See Also