TreeView.ExpandDepth Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the number of levels that are expanded when a TreeView control is displayed for the first time.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public int ExpandDepth { get; set; }

Property Value

Type: System.Int32

The depth to display when the TreeView is initially displayed. The default is -1, which displays all the nodes.

Use the ExpandDepth property to control the rendering of the TreeView control the first time that it is displayed. On subsequent postbacks, the nodes retain their current expanded state.

.NET Framework
Available since 2.0
Return to top