Home All Groups Group Topic Archive Search About

How to count total number of rows in the datagrid.

Author
31 Mar 2005 6:19 AM
patang
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.

Author
31 Mar 2005 6:31 AM
Daniel Ch. Bloch
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

Show quoteHide quote
"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.
Author
31 Mar 2005 6:41 AM
patang
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





Show quoteHide quote
"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.