如何允许分页gridview? [英] How to allow paging for gridview?

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

问题描述

我想允许对gridview进行分页。我已将PagerSettings属性设置为gridview。我也创建了OnPageIndexChanging事件...



这是我的代码..,



< pre lang =c#> protected void GrdATGmailContact_PageIndexChanging( object sender,GridViewPageEventArgs e)
{
GrdATGmailContact.PageIndex = e.NewPageIndex;
GrdATGmailContact.DataBind();
}





但是当我点击下一个按钮时。它不会显示网格。我该怎么做才能纠正这个错误?

解决方案

具有自定义分页的ASP.NET增强型网格视图 [ ^ ]

asp.net gridview中的分页 [ ^ ]

ASP.NET MVC的分页类 [ ^ ]



网格视图中的分页没有在ASP.net中的存储过程中传递分页参数 [ ^ ]



Quote:

设置Gridview的属性AllowPaging =true和pagesize =10





引用:

设置gridview属性AllowPaging =true;

和页面索引更改事件

  protected   void  GrdATGmailContact_PageIndexChanging( object  sender,GridViewPageEventArgs e)
{
GrdATGmailContact.PageIndex = e.NewPageIndex;
FillGrid(); // 绑定网格的方法
}









希望有所帮助。


网格视图的分页 [ ^ ]



查看此链接


使用ASP.NET中的GridView控件进行有效的分页 [ ^ ]



设置 allowpaging 网格视图的属性为 true

在pageindex更改事件中写入f ollowing code

 gridview1.pageindex = e.newpageindex; 
gridview1.databind();


I want to allow paging for the gridview. I have set PagerSettings properties to the gridview. Also i have created event of OnPageIndexChanging...

Here is my code..,

protected void GrdATGmailContact_PageIndexChanging(object sender,GridViewPageEventArgs e)
{
    GrdATGmailContact.PageIndex = e.NewPageIndex;
    GrdATGmailContact.DataBind();
}



But when i click on next button. It wont display grid. What should I do to correct this error??

解决方案

ASP.NET Enhanced Grid View with Custom Pagination[^]
paging in asp.net gridview[^]
Pagination Class for ASP.NET MVC[^]

Pagination In Grid veiw Without passing paging parameters in Stored Procedure In ASP.net[^]

Quote:

Set the Gridview''s properties AllowPaging="true" and pagesize="10"


or

Quote:

set gridview property AllowPaging="true" ;

and In page index changing event

protected void GrdATGmailContact_PageIndexChanging(object sender, GridViewPageEventArgs e)
       {
            GrdATGmailContact.PageIndex = e.NewPageIndex;
            FillGrid();//method to bind grid
        }





hope it helped.


Pagination for gird view[^]

Check this link


Effective Paging with GridView Control in ASP.NET[^]

Set allowpaging property of grid view to true
In pageindex changing event write the following code

gridview1.pageindex=e.newpageindex;
gridview1.databind();


这篇关于如何允许分页gridview?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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