使用分页时如何在网格视图中获取行数总数?
问题描述:
在我的Web应用程序中,我正在使用网格视图,我希望在使用分页概念时该网格视图的总行数.当前,它为我提供了当前页行数,而不是上一页或下一页数..
请帮忙..
在此先感谢...,
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...,
答
是的,您是对的,但是您可以使用datasoure它本身来了解Gridview中将有多少条记录
像这样的
Hi ,
yes you right but u can use the datasoure it self to know how many record will be in Gridview
like this one
int countGridViewNum= ds.Tables[0].Rows.Count;
或者您可以使用此
or you can use this one
int xx = 1;
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
xx++;
}
最好的问候
M.Mitwalli
Best Regards
M.Mitwalli
嗨..贝图
为什么不获得数据表中的行总数
它将在网格视图中为您提供总行数.
还是需要1页后的行数(在第二页上填充时)
请让我们知道要求
谢谢
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