RepeaterItemCollection.Count 속성

정의

컬렉션에 있는 RepeaterItem 개체의 수를 가져옵니다.

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

속성 값

Int32

컬렉션의 DataListItem 개체 수입니다.

구현

예제

전체 예제의 컨텍스트에서이 코드를 보려면 참조는 RepeaterItemCollection 클래스 항목입니다.

      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

설명

사용 하 여는 Count 속성의 수를 확인 하려면 RepeaterItem 개체는 RepeaterItemCollection 컬렉션입니다. Count 속성은 컬렉션의 상위를 확인 하려면 컬렉션을 반복할 때 일반적으로 사용 됩니다.

적용 대상

추가 정보