RepeaterItemCollection.Item Property

Gets the RepeaterItem object at the specified index in the collection.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public:
property RepeaterItem^ default [int] {
	RepeaterItem^ get (int index);
}
/** @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.

No code example is currently available or this language may not be supported.
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

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: