This documentation is archived and is not being maintained.

DataListItemCollection Class

Represents the collection of DataListItem objects in the DataList control. This class cannot be inherited.

For a list of all members of this type, see DataListItemCollection Members.


[Visual Basic]
NotInheritable Public Class DataListItemCollection
   Implements ICollection, IEnumerable
public sealed class DataListItemCollection : ICollection,
public __gc __sealed class DataListItemCollection : public
   ICollection, IEnumerable
public class DataListItemCollection implements ICollection,

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


The DataListItemCollection class represents a collection of DataListItem objects, which in turn represent the data items in a DataList control. To programmatically retrieve DataListItem objects from a DataList control, use one of the following methods:

  • Use the indexer to get a single DataListItem object 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 interface, 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.


Namespace: System.Web.UI.WebControls

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

Assembly: System.Web (in System.Web.dll)

See Also

DataListItemCollection Members | System.Web.UI.WebControls Namespace | DataListItem | DataList | Items | CopyTo | GetEnumerator | Count