How to count total number of rows in the datagrid.

G

Guest

I found the following to count the total number of VISIBLE rows of datagrid

datagrid.visiblerowcount

How do we count the total number of ACTUAL (not just visible) rows of
datagrid?

Thanks in advance.
 
G

Guest

Actual, I did not see a method or property to use for, but as a datagrid
always has a datasource behind, just ask for the number of rows in your
datatable, dataview or whatever you use as datasource - it will give you the
total number of rows...

Daniel
 
G

Guest

In my code, I am connecting to the datasource and after the data is copied to
the datagrid I am closing the connection.

DataGrid1.DataSource = ds.Tables("Employee")

Now I want to SUM the values of a particular column in the datagrid. So I
was thinking If I know the total number of rows in the datagrid, I could have
added the values of all the rows by running a loop or something...

Could you please tell me the right direction
 

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

Top