DataRepeater.DisplayedItemCount Property (Boolean)

 

Gets the number of DataRepeaterItem items that are visible in a DataRepeater control, optionally including partially displayed items.

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

Syntax

[BrowsableAttribute(false)]
public int this[
    bool includePartialItems
] { get; }
public:
[BrowsableAttribute(false)]
property int default[
    bool includePartialItems
] {
    int get(bool includePartialItems);
}
[<BrowsableAttribute(false)>]
member DisplayedItemCount : 
        includePartialItems:bool -> int with get
<BrowsableAttribute(False)>
Public ReadOnly Property DisplayedItemCount (
    includePartialItems As Boolean
) As Integer

Parameters

  • includePartialItems
    Type: System.Boolean

    true to include partially displayed items in the count; false to include only fully displayed items.

Property Value

Type: System.Int32

The count of displayed items.

Remarks

Use this property to determine how many DataRepeaterItem items are visible in a DataRepeater control.

Examples

The following example demonstrates how to return the count of displayed items in a DataRepeater control.

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);
}
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

See Also

FirstDisplayedItemIndex
DataRepeater Class
Microsoft.VisualBasic.PowerPacks Namespace
Introduction to the DataRepeater Control (Visual Studio)

Return to top