Connecting Tech Pros Worldwide Forums | Help | Site Map

GridView: Total Records

Amelyan
Guest
 
Posts: n/a
#1: Mar 30 '06
I need to get the total number of items/records returned into GridView.

If I just do myGridView.Rows.Count, then it just returns me the total number
of items on the page.

But if I have, 10 pages (10 records per page) and 98 records total,
Rows.Count will return me 10 on the first 9 pages, and 8, on the last page.

But, I need to somehow get access to total record count which is 98. What
is the proper/easy way to accomplish that?

Thanks,





Phillip Williams
Guest
 
Posts: n/a
#2: Mar 30 '06

re: GridView: Total Records


You need to use the ReturnValue of the ObjectDataSourceStatusEventArgs or
SqlDataSourceStatusEventArgs while handling the datasource's Selected event.
Look at this sample for the code:
http://www.webswapp.com/codesamples/...w/default.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com


"Amelyan" wrote:
[color=blue]
> I need to get the total number of items/records returned into GridView.
>
> If I just do myGridView.Rows.Count, then it just returns me the total number
> of items on the page.
>
> But if I have, 10 pages (10 records per page) and 98 records total,
> Rows.Count will return me 10 on the first 9 pages, and 8, on the last page.
>
> But, I need to somehow get access to total record count which is 98. What
> is the proper/easy way to accomplish that?
>
> Thanks,
>
>
>
>
>[/color]
sloan
Guest
 
Posts: n/a
#3: Mar 30 '06

re: GridView: Total Records


Phillip!

Thank you,

I have been looking for the Nested GridView sample (same web site, not the
page you give) for a few weeks now.

I didn't bookmark it, and figured I'd find it later.

Too much info on the internet sometimes.

...



"Phillip Williams" <WEBSWAPP@newsgroups.nospam> wrote in message
news:EED0BBEC-B0D1-4184-A20E-932AA6CA05F4@microsoft.com...[color=blue]
> You need to use the ReturnValue of the ObjectDataSourceStatusEventArgs or
> SqlDataSourceStatusEventArgs while handling the datasource's Selected[/color]
event.[color=blue]
> Look at this sample for the code:
>[/color]
http://www.webswapp.com/codesamples/...w/default.aspx[color=blue]
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Amelyan" wrote:
>[color=green]
> > I need to get the total number of items/records returned into GridView.
> >
> > If I just do myGridView.Rows.Count, then it just returns me the total[/color][/color]
number[color=blue][color=green]
> > of items on the page.
> >
> > But if I have, 10 pages (10 records per page) and 98 records total,
> > Rows.Count will return me 10 on the first 9 pages, and 8, on the last[/color][/color]
page.[color=blue][color=green]
> >
> > But, I need to somehow get access to total record count which is 98.[/color][/color]
What[color=blue][color=green]
> > is the proper/easy way to accomplish that?
> >
> > Thanks,
> >
> >
> >
> >
> >[/color][/color]


Phillip Williams
Guest
 
Posts: n/a
#4: Mar 30 '06

re: GridView: Total Records


You are welcome.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com


"sloan" wrote:
[color=blue]
> Phillip!
>
> Thank you,
>
> I have been looking for the Nested GridView sample (same web site, not the
> page you give) for a few weeks now.
>
> I didn't bookmark it, and figured I'd find it later.
>
> Too much info on the internet sometimes.
>
> ...
>
>
>
> "Phillip Williams" <WEBSWAPP@newsgroups.nospam> wrote in message
> news:EED0BBEC-B0D1-4184-A20E-932AA6CA05F4@microsoft.com...[color=green]
> > You need to use the ReturnValue of the ObjectDataSourceStatusEventArgs or
> > SqlDataSourceStatusEventArgs while handling the datasource's Selected[/color]
> event.[color=green]
> > Look at this sample for the code:
> >[/color]
> http://www.webswapp.com/codesamples/...w/default.aspx[color=green]
> > --
> > HTH,
> > Phillip Williams
> > http://www.societopia.net
> > http://www.webswapp.com
> >
> >
> > "Amelyan" wrote:
> >[color=darkred]
> > > I need to get the total number of items/records returned into GridView.
> > >
> > > If I just do myGridView.Rows.Count, then it just returns me the total[/color][/color]
> number[color=green][color=darkred]
> > > of items on the page.
> > >
> > > But if I have, 10 pages (10 records per page) and 98 records total,
> > > Rows.Count will return me 10 on the first 9 pages, and 8, on the last[/color][/color]
> page.[color=green][color=darkred]
> > >
> > > But, I need to somehow get access to total record count which is 98.[/color][/color]
> What[color=green][color=darkred]
> > > is the proper/easy way to accomplish that?
> > >
> > > Thanks,
> > >
> > >
> > >
> > >
> > >[/color][/color]
>
>
>[/color]
Closed Thread