|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GridView: Total Records CountI 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, 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. 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 Show quoteHide quote "Amelyan" <bamelyan at wi.rr.com> wrote in message news:%23WoXbfDVGHA.5884@TK2MSFTNGP14.phx.gbl... >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, > > > >
Problem with User Control and unset references to controls within
row count in inherited GridView control Use windows control in asp.net 2.0 GridView - can't reference value of a non-visible cell?? Dynamically created (and selected) radiobuttons fire CheckedChanged event on Postback error in adding user controls at runtime Panel with Header Gridview PostBack Problems Bounded Datagrid and Subtotal rows Image Server Control's Style/Border |
|||||||||||||||||||||||