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
'Declaration
<BrowsableAttribute(False)> _
Public Property ItemCount As Integer
[BrowsableAttribute(false)]
public int ItemCount { get; set; }
[BrowsableAttribute(false)]
public:
property int ItemCount {
int get ();
void set (int value);
}
[<BrowsableAttribute(false)>]
member ItemCount : int with get, set
function get ItemCount () : int
function set ItemCount (value : int)
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 Sub Button1_Click() Handles Button1.Click
MsgBox("The DataRepeater contains " &
CStr(DataRepeater1.ItemCount) & " items.")
End Sub
private void button1_Click(System.Object sender, System.EventArgs e)
{
string stringCount;
stringCount = dataRepeater1.ItemCount.ToString();
MessageBox.Show("The DataRepeater contains " + stringCount + " items.");
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualBasic.PowerPacks Namespace