带有下一页按钮的Gridview分页问题 [英] Gridview paging problem with next page button

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

问题描述

嗨...
当我单击一个按钮时,我将显示gridview ...现在我想设置页面调度属性,我已经设置了允许页面调度和其他属性..这是可行的,但是现在问题出在切换到下一页时,网格视图是不刷新,如果我再次单击该按钮,则Gridview正在运行..
谁能告诉我解决方案?

[edit]仅主题:尝试给出问题的简要摘要,而不是主题中的整个问题-OriginalGriff [/edit]

hi ...
when i click a button , i will show gridview...now i want to set the paging properties ,i had set allow paging and other properties.. that is working but now the problem is while changing to the next page, grid view is not refreshing and if i click again the button , the gridview is working..
can anyone tell me the solutions?

[edit]Subject only: try to give a concise summary of your problem, rather than the whole question in the subject - OriginalGriff[/edit]

推荐答案

添加pageindexchanging事件,例如:
add a pageindexchanging event , ex:
protected void gvCustomers_PageIndexChanging(object sender, GridViewPageEventArgs e)
  {
          gvCustomers.PageIndex = e.NewPageIndex;
          GridBind();//method to bind the gridview

  }


在单击页面编号时调用pageindexchanging事件.或<>"标志.
将页面索引设置为新页面索引.会的.尝试这个.
call pageindexchanging event on click of page no. or "< >" sign.
set page index to new page index. it will do. try this.


HI检查此事件:

HI check this event :

protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)

{

      GridView1.PageIndex = e.NewPageIndex;

}




并请添加您有问题的代码以获得更好的帮助.




And please add your code in question for better help.


这篇关于带有下一页按钮的Gridview分页问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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