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