Represents the collection of System.Web.UI.WebControls.DataListItem objects in the System.Web.UI.WebControls.DataList control. This class cannot be inherited.
See Also: DataListItemCollection Members
The System.Web.UI.WebControls.DataListItemCollection class represents a collection of System.Web.UI.WebControls.DataListItem objects, which in turn represent the data items in a System.Web.UI.WebControls.DataList control. To programmatically retrieve System.Web.UI.WebControls.DataListItem objects from a System.Web.UI.WebControls.DataList control, use one of the following methods:
Use the indexer to get a single System.Web.UI.WebControls.DataListItem object from the collection, using array notation.
Use the DataListItemCollection.CopyTo(Array, int) method to copy the contents of the collection to a Array object, which can then be used to get items from the collection.
Use the DataListItemCollection.GetEnumerator method to create a IEnumerator interface, which can then be used to get items from the collection.
The DataListItemCollection.Count property specifies the total number of items in the collection and is commonly used to determine the upper bound of the collection.