RepeaterItemCollection.Item[Int32] Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene el RepeaterItem objeto en el índice especificado de la colección.
public:
property System::Web::UI::WebControls::RepeaterItem ^ default[int] { System::Web::UI::WebControls::RepeaterItem ^ get(int index); };
public System.Web.UI.WebControls.RepeaterItem this[int index] { get; }
member this.Item(int) : System.Web.UI.WebControls.RepeaterItem
Default Public ReadOnly Property Item(index As Integer) As RepeaterItem
Parámetros
- index
- Int32
Índice de base cero del objeto RepeaterItem que se va a recuperar en la colección.
Valor de propiedad
Objeto RepeaterItem en el índice especificado de la colección.
Ejemplos
Para ver este código en el contexto de un ejemplo completo, consulte el tema de la RepeaterItemCollection clase .
void Item_Clicked(Object Sender, EventArgs e)
{
labelDisplay.Text = "Using item indexer.<br />";
labelDisplay.Text += "The Items collection contains: <br />";
// Display the elements of the RepeaterItemCollection using the indexer.
RepeaterItemCollection myItemCollection = myRepeater.Items;
for(int index=0;index < myItemCollection.Count;index++)
labelDisplay.Text += ((DataBoundLiteralControl)
myItemCollection[index].Controls[0]).Text + "<br />";
}
Sub Item_Clicked(Sender As [Object], e As EventArgs)
labelDisplay.Text = "Using item indexer.<br />"
labelDisplay.Text += "The Items collection contains: <br />"
' Display the elements of the RepeaterItemCollection using the indexer.
Dim myItemCollection As RepeaterItemCollection = myRepeater.Items
Dim index As Integer
For index = 0 To myItemCollection.Count - 1
labelDisplay.Text += CType(myItemCollection(index).Controls(0), DataBoundLiteralControl).Text + "<br />"
Next index
End Sub 'Item_Clicked
Comentarios
Use este indexador para obtener un RepeaterItem objeto de en el RepeaterItemCollection índice especificado mediante la notación de matriz.