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)

public int ItemCount { get; set; }

Property Value

Type: System.Int32

The count.

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.

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.");
Return to top