RepeaterItemCollection.Item[Int32] Özellik

Tanım

RepeaterItem Nesneyi koleksiyonda belirtilen dizinde alır.

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

Parametreler

index
Int32

Koleksiyonda alınacak sıfır tabanlı dizini RepeaterItem .

Özellik Değeri

RepeaterItem Koleksiyonda belirtilen dizindeki bir nesne.

Örnekler

Bu kodu tam bir örnek bağlamında görmek için sınıf konusuna RepeaterItemCollection bakın.

      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

Açıklamalar

Dizi gösterimini kullanarak belirtilen dizinden RepeaterItem bir RepeaterItemCollection nesne almak için bu dizin oluşturucuyu kullanın.

Şunlara uygulanır

Ayrıca bkz.