Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.87 KB

listviewbase_selectedranges.md

File metadata and controls

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

Windows.UI.Xaml.Controls.ListViewBase.SelectedRanges

-description

Gets a collection of ItemIndexRange objects that describe the currently selected items in the list.

-property-value

The collection of ItemIndexRange objects that describe the currently selected items in the list. The default is an empty collection.

-remarks

Each ItemIndexRange in the SelectedRanges collection describes a contiguous block of selected items. ItemIndexRange describes the selection by index, so item objects don't need to be created. 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.

If your datasource performs data virtualization, you can use the SelectedRanges property with the SelectRange and DeselectRange methods to modify selection of items that have not been created yet.

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

SelectRange, DeselectRange, ItemIndexRange