RepeaterItemCollection Class
Assembly: System.Web (in system.web.dll)
'Declaration Public NotInheritable Class RepeaterItemCollection Implements ICollection, IEnumerable 'Usage Dim instance As RepeaterItemCollection
public final class RepeaterItemCollection implements ICollection, IEnumerable
public final class RepeaterItemCollection implements ICollection, IEnumerable
The RepeaterItemCollection class represents a collection of RepeaterItem objects, which in turn represent the data items in a Repeater control. To programmatically retrieve RepeaterItem objects from a Repeater control, use one of the following methods:
-
Use the indexer to get a single RepeaterItem 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 an System.Collections.IEnumerator interface, which can then be used to get items from the collection.
-
Use foreach (C#) or For Each (Visual Basic) to iterate throught 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.
Sub Page_Load(Sender As Object, e As EventArgs) If Not IsPostBack Then Dim myDataSource As New ArrayList() myDataSource.Add(New PositionData("Item 1", "$6.00")) myDataSource.Add(New PositionData("Item 2", "$7.48")) myDataSource.Add(New PositionData("Item 3", "$9.96")) ' Initialize the RepeaterItemCollection using the ArrayList as the data source. Dim myCollection As New RepeaterItemCollection(myDataSource) myRepeater.DataSource = myCollection myRepeater.DataBind() End If End Sub 'Page_Load
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.