Net-informations.com
SiteMap  | About    

Treeview Control



The TreeView control contains a hierarchy of TreeViewItem controls. You can use the TreeView control to display information from a wide variety of data sources such as an XML file, site-map file, string, or from a database. It provides a way to display information in a hierarchical structure by using collapsible nodes . The top level in a tree view are root nodes that can be expanded or collapsed if the nodes have child nodes.

treeview-control

The user can expand the TreeNode by clicking the plus sign (+) button, if one is displayed next to the TreeNode, or you can expand the TreeNode by calling the TreeNode.Expand method

The fullpath method of treeview control provides the path from root node to the selected node.

VB.Net

C#

The following ASP.NET program shows how to load data from an XML file to a Treeview control. The XML file you can download from

http://asp.net-informations.com/webcontrols/websites.xml

Default.aspx




Click the following links to see full source code

C# Source Code
VB.NET Source Code
default.aspx.cs
default.aspx.vb





net-informations.com (C) 2019    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.