使用分页时如何在网格视图中获取行数总数? [英] how to get total number of row count in grid view while using paging?

查看:41
本文介绍了使用分页时如何在网格视图中获取行数总数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的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


这篇关于使用分页时如何在网格视图中获取行数总数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆