Method SetSelected
SetSelected(TreeViewItem, bool)
Selects or clears the selection for the specified item.
public void SetSelected(TreeViewItem item, bool value)
Parameters
itemTreeViewItemThe item to select or clear the selection for.
valuebooltrueto select the specified item; otherwise,false.
Remarks
You can use this method to set the selection of items in a multiple-selection tree control. To select an item in a single-selection tree control, use the SelectedItem property.