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
 
Back
Top