asp.net.ph

Skip Navigation Links

TreeView Control Syntax

ASP.NET Syntax   ASP.NET Syntax for Web Controls


Displays hierarchical data, such as a table of contents, in a tree structure.

Declarative Syntax

For information on the individual members of this class, see TreeView in the class library.

Remarks

The TreeView control renders hierarchical data, such as a table of contents or file directory, into a tree-like structure, and supports the following features:

  • Data binding support that allows the nodes of the control to be bound to XML, tabular, or relational data.
  • Site navigation support through integration with the SiteMapDataSource control.
  • Node text that can be displayed as either plain text or hyperlinks.
  • Programmatic access to the TreeView object model to create trees, populate nodes, set properties, and so on, dynamically.
  • Client-side node population (on supported browsers).
  • The ability to display a check box next to each node.
  • The ability to customize appearance through themes, user-defined images, and styles.

Syntax Example

The following example demonstrates how to bind the TreeView control to a SiteMapDataSource control.

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

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

 Show me 

See Also

TreeView Class   TreeView Web Server Control



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

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