asp.net.ph

TreeView.ExpandDepth Property

System.Web.UI.WebControls Namespace   TreeView Class


.NET Framework version 2.0

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

Syntax


Inline <asp:treeview expanddepth = intValue ... >
Script TreeView.ExpandDepth [ = intValue ]

Property Value


intValue The depth to display when the TreeView is initially rendered.

The property is read/write with a default value of -1, which displays all the nodes.

Remarks

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.

Example

The following example demonstrates how to use the ExpandDepth property to set the number of levels to display when the TreeView is initially rendered.

<asp:treeview id = "myTreeView" runat = "server"
   datasourceid = "siteMap"
   imageset = "XPFileExplorer"
   showlines
   expanddepth=1 />

<asp:sitemapdatasource id = "siteMap" runat = "server" />

 Show me 

See Also

TreeView Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph