RepeaterItemCollection.Count Property
.NET Framework 3.0
Gets the number of RepeaterItem objects in the collection.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
Use the Count property to determine the number of RepeaterItem objects in the RepeaterItemCollection collection. The Count property is commonly used when iterating through the collection to determine the upper bound of the collection.
To see this code in the context of a complete example, see the RepeaterItemCollection class topic.
void Item_Clicked(Object Sender, EventArgs e)
{
labelDisplay.set_Text("Using item indexer.<br />");
labelDisplay.set_Text(labelDisplay.get_Text()
+ "The Items collection contains: <br />");
// Display the elements of the RepeaterItemCollection using
// the indexer.
RepeaterItemCollection myItemCollection = myRepeater.get_Items();
for(int index=0;index < myItemCollection.get_Count();index++) {
labelDisplay.set_Text(labelDisplay.get_Text()
+ ((DataBoundLiteralControl)(myItemCollection.get_Item(
index).get_Controls().get_Item(0))).get_Text() + "<br />");
}
} //Item_Clicked
Community Additions
ADD
Show: