Method SetSelected
SetSelected(TreeViewItem, bool)
Selects or clears the selection for the specified item in a TreeView.
public virtual void SetSelected(TreeViewItem item, bool value)
Parameters
itemTreeViewItemThe item in a TreeView 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 TreeView. To select an item in a single-selection TreeView, use the SelectedItem property.