IsSelected Property
Collapse the table of content
Expand the table of content

TreeViewItem.IsSelected Property


Gets or sets whether a TreeViewItem control is selected.

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

public bool IsSelected { get; set; }

Property Value

Type: System.Boolean

true if the TreeViewItem is selected; otherwise, false. The default is false.

When the IsSelected property value changes to true, the Selected event occurs. When the IsSelected property value changes to false, the Unselected event occurs.

Identifier field


Metadata properties set to true


The following example shows how to set the IsSelected property.

.NET Framework
Available since 3.0
Available since 3.0
Return to top
© 2015 Microsoft