By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,143 Members | 1,855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,143 IT Pros & Developers. It's quick & easy.

How to count total number of rows in the datagrid.

P: n/a
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.
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

"patang" wrote:
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.

Nov 21 '05 #2

P: n/a
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

"Daniel Ch. Bloch" wrote:
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

"patang" wrote:
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.

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.