Click here to Skip to main content
14,870,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my web application i am using a grid view, I want total number of row count of that gridview while using paging concept. currently it gives me current page row count not previous or next page count..
please help..
thanks in advance...,
Posted

Hi ,
yes you right but u can use the datasoure it self to know how many record will be in Gridview

like this one
C#
int countGridViewNum= ds.Tables[0].Rows.Count;


or you can use this one
C#
int xx = 1;
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    xx++;
}



Best Regards
M.Mitwalli
   
v2
Comments
betu.009 2-Apr-12 6:58am
   
thanks a lot
Mohamed Mitwalli 2-Apr-12 7:22am
   
your welcome :)
Shwrv 10-Apr-16 21:47pm
   
nice. how can i solve filtering gridview count rows. Only count filtering rows from gridview. thnx
Hi..Betu

Why don't you get total no of rows in datatable
it will give you total no of rows in grid view.

Or do you need the row count after 1 page(while you are suffring on the second page)

Please let us know the requirement

Thanks
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900