IsSelected Property

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

IsSelectedProperty

Metadata properties set to true

BindsTwoWayByDefault

The following example shows how to set the IsSelected property.

EmployeeWorkDays.IsSelected = true;
<TreeViewItem Header="Work Days" 
              Name="EmployeeWorkDays"
              IsSelected="True">

.NET Framework
Available since 3.0
Silverlight
Available since 3.0
Return to top
Show:
© 2016 Microsoft