इसके माध्यम से साझा किया गया


ListViewBase.SelectedItems Property

Definition

Gets the currently selected items.

public:
 property IVector<Platform::Object ^> ^ SelectedItems { IVector<Platform::Object ^> ^ get(); };
IVector<IInspectable> SelectedItems();
public IList<object> SelectedItems { get; }
var iVector = listViewBase.selectedItems;
Public ReadOnly Property SelectedItems As IList(Of Object)

Property Value

IVector<Object>

IList<Object>

IVector<Platform::Object>

IVector<IInspectable>

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.

Applies to

See also