System.Web.UI.WebControls Namespace
Represents the collection of Items in a DataList control.
The DataListItemCollection class represents a collection of DataListItem objects, that in turn represent the data items displayed in a DataList control. To programmatically retrieve DataListItem objects from a DataList control, use one of following methods:
- Use the indexer to get a single DataListItem from the collection, using array notation.
- Use the CopyTo method to copy the contents of the collection to a System.Array object, which can then be used to get items from the collection.
- Use the GetEnumerator method to create a System.Collections.IEnumerator implemented object, which can then be used to get items from the collection.
The Count property specifies the total number of items in the collection, and is commonly used to determine the upper bound of the collection.
NOTE: The DataListItemCollection is read-only; as such, it does not provide any methods to add or remove items in the collection.
DataList DataList.Items DataListItem