Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > GridView: Total Records Count

Reply
Thread Tools

GridView: Total Records Count

 
 
Amelyan
Guest
Posts: n/a
 
      03-30-2006
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,




 
Reply With Quote
 
 
 
 
CaffieneRush@gmail.com
Guest
Posts: n/a
 
      03-30-2006
The easy way is to return the count as an extra column in your data
source.
Like you I'm also waiting to hear the proper way.

Regards.

 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      03-30-2006
I'd suggest you get the row count from the underlying data source. Perhaps
you're using a DataSet? If so, you'd check MyDataSet.Tables[0].Rows.Count

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Amelyan" <bamelyan at wi.rr.com> wrote in message
news:%(E-Mail Removed)...
>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,
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView: Total Records Amelyan ASP .Net 9 10-24-2011 09:55 AM
BT Total Broadband vs BT Business Total John Y UK VOIP 2 02-02-2007 09:27 AM
ASP.NET: Repeater: Total no. of Records in Footer Sachin ASP .Net 2 03-05-2006 05:45 PM
How to get the total number of queried records? Quentin Huo ASP .Net 5 09-01-2004 10:53 PM
How to know total records selected? anand ASP .Net 4 06-17-2004 07:03 AM



Advertisments