System.Web.UI.WebControls.DataList.CreateControlHierarchy Method

Creates the control hierarchy that is used to render the data list control, with or without the specified data source.

Syntax

protected override void CreateControlHierarchy (bool useDataSource)

Parameters

useDataSource
true to use the control's data source; false to indicate that the control is being recreated from view state and should not be data-bound.

Remarks

The DataList.CreateControlHierarchy(bool) method is used primarily by control developers when deriving a custom implementation from the System.Web.UI.WebControls.DataList control.

The DataList.CreateControlHierarchy(bool) method uses the DataList.CreateItem(int, ListItemType) and DataList.InitializeItem(DataListItem) methods to create System.Web.UI.WebControls.DataListItem controls that represent the header, footer, separator, and data-bound items contained in the data list. You can access the data-bound items for the data list through the DataList.Items collection. You can access all item types, including the header, footer, and separator items, through the BaseDataList.Controls collection.

Override the DataList.CreateControlHierarchy(bool) method to customize how System.Web.UI.WebControls.DataListItem controls are created or added to the System.Web.UI.WebControls.DataList control. Override the DataList.InitializeItem(DataListItem) method to customize templates for a System.Web.UI.WebControls.DataListItem control.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0