다음을 통해 공유


DataRepeater.DisplayedItemCount 속성

매핑되는 DataRepeaterItem 에서 볼 수 있는 항목은 DataRepeater 필요에 따라 부분적으로 포함 하 여 컨트롤에 표시 된 항목.

네임스페이스:  Microsoft.VisualBasic.PowerPacks
어셈블리:  Microsoft.VisualBasic.PowerPacks.Vs(Microsoft.VisualBasic.PowerPacks.Vs.dll)

구문

‘선언
<BrowsableAttribute(False)> _
Public ReadOnly Property DisplayedItemCount ( _
    includePartialItems As Boolean _
) As Integer
[BrowsableAttribute(false)]
public int this[
    bool includePartialItems
] { get; }
[BrowsableAttribute(false)]
public:
property int DisplayedItemCount[bool includePartialItems] {
    int get (bool includePartialItems);
}
[<BrowsableAttribute(false)>]
member DisplayedItemCount : int
JScript에서는 인덱싱된 속성을 지원하지 않습니다.

매개 변수

  • includePartialItems
    형식: System.Boolean
    true 부분적으로 표시 된 항목을 개수에 포함. false완전 하 게 표시 된 항목만 포함.

속성 값

형식: System.Int32
표시 된 항목의 수입니다.

설명

이 속성을 사용 하 여 확인할 수 얼마나 많은 DataRepeaterItem 항목에 표시 되는 DataRepeater 컨트롤입니다.

예제

다음 예제에 표시 된 항목의 개수를 반환 하는 방법을 보여 줍니다 있는 DataRepeater 컨트롤입니다.

Private Sub Button1_Click() Handles Button1.Click
    Dim msgString As String
    Dim intFull As Integer
    Dim intPartial As Integer
    ' Get the count without including partially displayed items.
    intFull = DataRepeater1.DisplayedItemCount(False)
    ' Get the count, including partially displayed items.
    intPartial = DataRepeater1.DisplayedItemCount(True)
    ' Create the message string.
    msgString = CStr(intFull)
    msgString &= " items are fully visible and "
    ' Subtract the full count from the partial count.
    msgString &= CStr(intPartial - intFull)
    msgString &= " items are partially visible."
    MsgBox(msgString)
End Sub
private void button1_Click(System.Object sender, System.EventArgs e)
{
    string msgString;
    int intFull;
    int intPartial;
    string stringFull;
    string stringPartial;
    // Get the count without including partially displayed items.
    intFull = dataRepeater1.get_DisplayedItemCount(false);
    // Get the count, including partially displayed items.
    intPartial = dataRepeater1.get_DisplayedItemCount(true);
    // Create the message string.
    stringFull = intFull.ToString();
    msgString = stringFull;
    msgString = msgString + " items are fully visible and ";
    // Subtract the full count from the partial count.
    intPartial = intPartial - intFull;
    stringPartial = intPartial.ToString();
    msgString = msgString + stringPartial;
    msgString = msgString + " items are partially visible.";
    MessageBox.Show(msgString);
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

DataRepeater 클래스

Microsoft.VisualBasic.PowerPacks 네임스페이스

FirstDisplayedItemIndex

기타 리소스

DataRepeater 컨트롤 소개(Visual Studio)