Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.98 KB

listviewbase_selecteditems.md

File metadata and controls

31 lines (20 loc) · 1.98 KB
-api-id -api-type
P:Windows.UI.Xaml.Controls.ListViewBase.SelectedItems
winrt property

Windows.UI.Xaml.Controls.ListViewBase.SelectedItems

-description

Gets the currently selected items.

-property-value

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.

-examples

-see-also

SelectionMode, Selector.SelectedItem, Selector.SelectedIndex, Selector.SelectionChanged, SelectedRanges, SelectRange, DeselectRange