Represents a hierarchical data source that hierarchical data-bound controls such as System.Web.UI.WebControls.TreeView can bind to.

See Also: IHierarchicalDataSource Members


public interface IHierarchicalDataSource


ASP.NET supports a control data-binding architecture that enables Web server controls to bind to data and present it in a consistent fashion. Web server controls that bind to data are called data-bound controls, and the classes that facilitate binding are called data source controls. Data source controls can represent any data source: a file, a stream, a relational database, a business object, and so on. Data source controls present data in a consistent way to data-bound controls, regardless of the source or format of the underlying data.

Data source controls that represent hierarchical data derive from the System.Web.UI.HierarchicalDataSourceControl class, which is the base ASP.NET implementation of the System.Web.UI.IHierarchicalDataSource interface. The System.Web.UI.IHierarchicalDataSource interface is used to define data source controls that expose hierarchical data, rather than tabular or list-style data, to Web server controls that derive from the System.Web.UI.WebControls.HierarchicalDataBoundControl class, such as the System.Web.UI.WebControls.TreeView control. The interface defines a single method, IHierarchicalDataSource.GetHierarchicalView(string), which retrieves a strongly typed System.Web.UI.HierarchicalDataSourceView object. Data source controls that implement this interface support a hierarchical view for each hierarchical level of data they represent. The data source views are not named, like System.Web.UI.DataSourceView objects, but are identified by their unique hierarchical path, which is the viewPath parameter passed to the IHierarchicalDataSource.GetHierarchicalView(string) method.

You can think of a data source control as the combination of the System.Web.UI.IHierarchicalDataSource object and its associated views on the underlying data. Each associated System.Web.UI.HierarchicalDataSourceView object defines the capabilities of a data source control for the hierarchical level represented, and, like all ASP.NET data source view objects, performs operations such as insert, update, delete, and sort.

Data source controls that expose only hierarchical data, such as System.Web.UI.WebControls.SiteMapDataSource, are derived from the System.Web.UI.HierarchicalDataSourceControl class. Other data source controls that expose their data as both hierarchical data and tabular data, such as System.Web.UI.WebControls.XmlDataSource, are derived from System.Web.UI.HierarchicalDataSourceControl but implement the System.Web.UI.IDataSource and System.ComponentModel.IListSource interfaces.


Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions:
Since: .NET 2.0