number of rows in a datagrid

  • Thread starter Thread starter Curtis
  • Start date Start date
C

Curtis

Is there a way to find out the number of rows in a datagrid without
accessing the original datatable or dataset on which the recordsource is
based?

x = datagrid1.rows.count would be cool, but it's not there.
 
Is there a way to find out the number of rows in a datagrid without
accessing the original datatable or dataset on which the recordsource is
based?

You can find it from the count of the data in the grid which is the
datasource, why should there be another methode?

Cor
 
That's fine. My confusion was that the datasource was no longer declared by
the time I wanted to know how many rows. It hadn't initially occurred to me
to dim a new dataset and make it equal to the datasource of the datagrid in
order to get the count property.
 
Hi Curtis

You dont have to redeclare another dataset if all you want is a row count.

Me.BindingContext(Me.dgMyDataGrid.Datasource).Count

should do the trick.

hth
Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top