Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I determine the number of rows in a DataGrid?

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

[C#]

int numRows =
  dataGrid1.BindingContext[ dataGrid1.DataSource, dataGrid1.DataMember ].Count;

Contributed from George Shepherd's Windows Forms FAQ