RepeaterItemCollection.Item Property
.NET Framework 3.0
Gets the RepeaterItem object at the specified index in the collection.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
/** @property */ public RepeaterItem get_Item (int index)
Not applicable.
Parameters
- index
The zero-based index of the RepeaterItem to retrieve in the collection.
Property Value
A RepeaterItem object at the specified index in the collection.Use this indexer to get a RepeaterItem object from the RepeaterItemCollection at the specified index, using array notation.
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: