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.
System.Object
System.Web.UI.WebControls.DataListItemCollection
[Visual Basic] NotInheritable Public Class DataListItemCollection Implements ICollection, IEnumerable [C#] public sealed class DataListItemCollection : ICollection, IEnumerable [C++] public __gc __sealed class DataListItemCollection : public ICollection, IEnumerable [JScript] public class DataListItemCollection implements ICollection, IEnumerable
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.
Remarks
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.
Requirements
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