在每个分页中找到gridview的第一个和最后一个行索引号 [英] Find first and last Row Index No for a gridview in each paging

查看:137
本文介绍了在每个分页中找到gridview的第一个和最后一个行索引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个gridview包含数百条记录,它正在分页,每页的大小为50.现在我想在每个分页事件中找到gridview的第一行和最后一行的索引号. >解决方案

由于看不到您的编码流程,我无法帮助您完成代码.尽管如此,我还是可以给您一点点想法.
在页面上的一个隐藏字段中,第一个时间设置为0.绝对地,最后一个索引将是第一个索引的+50,因为您告诉您要显示50行.现在在gridview的页面索引更改事件中,将您的隐藏字段值增加到50.

终于,您在这里找到了解决方案.隐藏字段值将包含整个数据当前页面的第一行索引,当您将其添加50时,它将成为整个数据当前页面的最后一行索引.


--Amit


Hi i have a gridview contains hundred of records, it is having paging, every page have size 50. now i want to find the first & last row index numbers of the gridview in each paging event.

解决方案

I can''t help you through the code, because I have not seen the flow of your coding.In spite of that I can give you a little idea.
Take a hidden field on the page and first time set is to 0. Definitely the last index will be +50 of the first index as you are telling that you are having 50 rows as a time to display. Now in page index changing event of gridview increase your hidden field value to 50.

Finally you got the solution here. The hidden field value will contain the first row index of the current page of entire data and when you''ll add 50 to it that will be the last row index of the current page of your entire data.


--Amit


这篇关于在每个分页中找到gridview的第一个和最后一个行索引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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