Property SelectedItem
SelectedItem
Gets or sets the currently selected item in the TreeView.
[Browsable(false)]
public virtual TreeViewItem? SelectedItem { get; set; }
Property Value
- TreeViewItem
A TreeViewItem object that represents the current selection in the control, or
null
if no item is selected.
Remarks
You can use this property to determine the item that is selected in the TreeView. If the SelectionMode property of the TreeView is set to Multiple and multiple items are selected in the tree, this property can return any selected item.
To retrieve a collection containing all selected items in a multiple-selection TreeView, use the SelectedItems property.