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
item
TreeViewItemThe item in a TreeView 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 TreeView. To select an item in a single-selection TreeView, use the SelectedItem property.