Initializes a System.Web.UI.WebControls.DataListItem object based on the specified templates and styles for the list-item type.
- item
- The System.Web.UI.WebControls.DataListItem to initialize.
The DataList.InitializeItem(DataListItem) method is used primarily by control developers to extend 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.