Method SetSelected
SetSelected(long, bool)
Selects or clears the selection for the specified item in a ListView.
public void SetSelected(long index, bool value)
Parameters
index
longThe zero-based index of the item in a ListView to select or clear the selection for.
value
booltrue
to select the specified item; otherwise, false.
Remarks
You can use this method to set the selection of items in a multiple-selection ListView. To select an item in a single-selection ListView, use the SelectedIndex property.
Exceptions
- ArgumentOutOfRangeException
The specified index was outside the range of valid values.