TreeView.SelectedValuePath Property

Gets or sets the path that is used to get the SelectedValue of the SelectedItem in a TreeView.

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

public string SelectedValuePath { get; set; }
/** @property */
public String get_SelectedValuePath ()

/** @property */
public void set_SelectedValuePath (String value)

public function get SelectedValuePath () : String

public function set SelectedValuePath (value : String)

<object SelectedValuePath="string" .../>

Property Value

A string that contains the path that is used to get the SelectedValue. The default value is String.Empty.

Identifier field


Metadata properties set to true


The value of the SelectedValuePath is used to determine the SelectedValue for the SelectedItem in a TreeView. For more information, see How to: Use SelectedValue, SelectedValuePath and SelectedItem.

The following example shows how to access the SelectedValuePath property.

string selectedTVValuePath = myTreeView.SelectedValuePath;

More Code

How to: Use SelectedValue, SelectedValuePath, and SelectedItem

This example shows how to use the SelectedValue and SelectedValuePath properties to specify a value for the SelectedItem of a TreeView.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions