TreeView.SelectedItem Property

Gets the selected item in a TreeView.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls (in System.Windows.Controls.dll)

public Object SelectedItem { get; private set; }

Property Value

Type: System.Object
The currently selected item or null if no item is selected. The default value is null.

Dependency property identifier field: SelectedItemProperty

When the value of SelectedItem changes, the SelectedItemChanged event occurs.

SelectedItem is a read-only property. To set the selected item for a TreeView, set the IsSelected property of a TreeViewItem.


Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions