Working with Hierarchical DataBound
Controls
A hierarchical DataBound
control can display nested data items. For example, you can use hierarchical DataBound
controls to display the folder and page structure of your website, the contents of an XML file, or a set of master/detail database records.
The ASP.NET 4 Framework includes two hierarchical DataBound
controls:
• Menu
—
Displays data items in a static or dynamic menu.
• TreeView
—
Displays data items in a tree.
The page in Listing 8.3 illustrates how you can use both the Menu
and TreeView
controls. Both controls are bound to an XmlDataSource
control, which represents the XML file in Listing 8.4 (see Figure 8.3).
Figure 8.3. Using hierarchical DataBound
controls.
Listing 8.3. ShowHierarchicalDataBound.aspx ...
Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.