ListViewBase.SelectedRanges Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a collection of ItemIndexRange objects that describe the currently selected items in the list.
public:
property IVectorView<ItemIndexRange ^> ^ SelectedRanges { IVectorView<ItemIndexRange ^> ^ get(); };
IVectorView<ItemIndexRange> SelectedRanges();
public IReadOnlyList<ItemIndexRange> SelectedRanges { get; }
var iVectorView = listViewBase.selectedRanges;
Public ReadOnly Property SelectedRanges As IReadOnlyList(Of ItemIndexRange)
The collection of ItemIndexRange objects that describe the currently selected items in the list. The default is an empty collection.
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.
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |