This documentation is archived and is not being maintained.

HierarchicalDataBoundControl Class

Serves as the base class for all ASP.NET version 2.0 data-bound controls that display their data in hierarchical form.

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

public abstract class HierarchicalDataBoundControl extends BaseDataBoundControl
<asp:HierarchicalDataBoundControl />

The HierarchicalDataBoundControl class is the base class used for ASP.NET controls that retrieve data from an ASP.NET hierarchical data source control and bind user-interface elements of the control to that data for display. The TreeView and Menu classes derive from HierarchicalDataBoundControl.

Page developers do not use the HierarchicalDataBoundControl class directly; instead, they use controls that derive from this class.

Controls developers extend this class to create data-bound controls that work with classes that implement the IHierarchicalDataSource interface and classes that derive from the HierarchicalDataSourceControl and HierarchicalDataSourceView classes. When deriving a class from the HierarchicalDataBoundControl class, override the PerformDataBinding method to bind the user-interface elements of your control to data retrieved by the GetData method. In most cases, the PerformDataBinding method is the only method you will override in your derived class.

For ASP.NET 2.0 data-bound controls, the PerformSelect method is the equivalent of the DataBind method, and is called to bind data at run time. The PerformSelect method calls the GetData and PerformDataBinding methods.

The following code example demonstrates how to derive a class from the HierarchicalDataBoundControl class to create a custom data-bound control. The GeneologyTree control renders a pre HTML section with a text tree for the data retrieved from an associated data source control.

No code example is currently available or this language may not be supported.

The following code example demonstrates how to use the GeneologyTree control, defined in the previous example, and bind it to an XmlDataSource control.

No code example is currently available or this language may not be supported.

The geneology.xml file accessed in the code example contains the following data.

  <member title="great-grandfather">
    <member title="grandfather" >
      <member title="child" />
      <member title="father" >
         <member title="son" />


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0