Share via


DataRepeater.ItemCount Property

 

Gets or sets the number of DataRepeaterItem items that are in a DataRepeater control.

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

Syntax

[BrowsableAttribute(false)]
public int ItemCount { get; set; }
public:
[BrowsableAttribute(false)]
property int ItemCount {
    int get();
    void set(int value);
}
[<BrowsableAttribute(false)>]
member ItemCount : int with get, set
<BrowsableAttribute(False)>
Public Property ItemCount As Integer

Property Value

Type: System.Int32

The count.

Remarks

Set this property to specify the number of items in the DataRepeater control when the VirtualMode property is set to True.

When the DataRepeater is bound to a DataSource, this value is the same as the value displayed in the BindingNavigatorCountItem label of the BindingNavigator.

Examples

The following code example demonstrates how to return the number of DataRepeaterItem items in a DataRepeater control. It assumes that you have a form that contains a DataRepeater control named DataRepeater1 and a Button named Button1.

private void button1_Click(System.Object sender, System.EventArgs e)
{
    string stringCount;
    stringCount = dataRepeater1.ItemCount.ToString();
    MessageBox.Show("The DataRepeater contains " + stringCount + " items.");
}
Private Sub Button1_Click() Handles Button1.Click
    MsgBox("The DataRepeater contains " & 
     CStr(DataRepeater1.ItemCount) & " items.")
End Sub

See Also

DataRepeater Class
Microsoft.VisualBasic.PowerPacks Namespace
Introduction to the DataRepeater Control (Visual Studio)
Virtual Mode in the DataRepeater Control (Visual Studio)

Return to top