DataRepeater.DisplayedItemCount-Eigenschaft

Aktualisiert: November 2007

Ruft die Anzahl der DataRepeaterItem-Elemente ab, die in einem DataRepeater-Steuerelement sichtbar sind, einschließlich teilweise sichtbarer Elemente (optional).

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

<BrowsableAttribute(False)> _
Public ReadOnly Property DisplayedItemCount ( _
    includePartialItems As Boolean _
) As Integer

Dim instance As DataRepeater
Dim includePartialItems As Boolean
Dim value As Integer

value = instance.DisplayedItemCount(includePartialItems)
[BrowsableAttribute(false)]
public int DisplayedItemCount[
    bool includePartialItems
] { get; }
[BrowsableAttribute(false)]
public:
property int DisplayedItemCount[bool includePartialItems] {
    int get (bool includePartialItems);
}
JScript unterstützt keine indizierten Eigenschaften.

Parameter

  • includePartialItems
    Typ: System.Boolean

    true, um teilweise angezeigte Elemente in die Anzahl einzuschließen, false, um nur voll angezeigte Elemente einzuschließen.

Eigenschaftenwert

Typ: System.Int32

Die Anzahl der angezeigten Elemente.

Hinweise

Mit dieser Eigenschaft können Sie ermitteln, wie viele DataRepeaterItem-Elemente in einem DataRepeater-Steuerelement sichtbar sind.

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie die Anzahl angezeigter Elemente in einem DataRepeater-Steuerelement zurückgegeben wird.

Private Sub Button1_Click(ByVal sender As System.Object, _
 ByVal e As System.EventArgs) 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 = msgString & " items are fully visible and "
    ' Subtract the full count from the partial count.
    msgString = msgString & CStr(intPartial - intFull)
    msgString = 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);
}

Berechtigungen

Siehe auch

Referenz

DataRepeater-Klasse

DataRepeater-Member

Microsoft.VisualBasic.PowerPacks-Namespace

FirstDisplayedItemIndex

Weitere Ressourcen

Einführung in das DataRepeater-Steuerelement (Visual Studio)