Live Chat Icon For mobile
Live Chat Icon

How can I get the number of rows in my DataGrid

Platform: WinForms| Category: Datagrid

One way you can do this is through the BindingManager.Count property.

[C#]
	int numRows = dataGridDetails.BindingContext[dataGridDetails.DataSource, dataGridDetails.DataMember].Count;

[VB.NET]
	Dim numRows as Integer = i dataGridDetails.BindingContext(dataGridDetails.DataSource, dataGridDetails.DataMember).Count;

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.