GridView页面索引问题 [英] Gridview page index problem

查看:61
本文介绍了GridView页面索引问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我对gridview的使用有疑问.我正在使用gridview来显示来自网站的数据.

有一个时间过滤器(日历),可让用户控制gridview数据的时间范围.
当用户生成报告(查询特定时间,该时间是从页面上的日历中选择的)时,它将获得报告.然后,由于报告有很多页面,因此他/她开始移动到报告的下一页,并假设他来到了第9页.

之后,如果他/她更改了时间段(更改了日历的日期时间),并在页面中进行了另一个查询而没有关闭第一个查询.新的结果起始页为9,而不是1.

当我在本地PC上进行调试时,这没有发生,但是当我将代码部署到服务器时,它的工作原理如上.太奇怪了.

任何帮助将不胜感激.

在此先感谢

Lilly

Hello,

I have a question about usage of gridview. I am using a gridview to showing the data from the website.

There is a time filter (calender) to give the users to control the gridview data time range.
When a user generate a report (make a query for a spesific time, that picked from the calender at the page) it gets a report. Then, because of the report has many pages, he/she starts to move to the next pages of the report and lets assume he came to the 9th page.

After then If he/she alters the time period (alter the date time at the calender) and make another query in the page without closing the first query. The new result starting page is 9, not 1.

When I am doing debug in my local pc, it is not happenning but when I deploy the code to the server it works like above. Which is so weird.

Any help would be appreciated.

Thanks in advance

Lilly

推荐答案

Before Binding Gridview with DataSet or DataTable You should set PageIndex property of GridView to Zero.
I think this will be help to you.


您好,当您在那时重新绑定Grid视图时,请将PageIndex设置为零.

Hi frnd when you rebind the Grid view at that time Please make PageIndex to Zero.

GridView1.PageIndex=0;



希望对您有帮助



hope it will help you


这篇关于GridView页面索引问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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