加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

具有无限页码的ASP.Net GridView数字分页

发布时间:2020-12-16 03:25:56 所属栏目:asp.Net 来源:网络整理
导读:我有一个启用了分页的GridView,并且PageSettings Mode设置为“Numeric”.此设置目前正确显示十页或更少: 1 2 3 4 5 6 7 8 9 10 当它到达11个或更多页面时,它会在末尾附加“…”(省略号)以便对页面进行分页.十一页或更多页面看起来像: 1 2 3 4 5 6 7 8 9 10
我有一个启用了分页的GridView,并且PageSettings Mode设置为“Numeric”.此设置目前正确显示十页或更少:

1 2 3 4 5 6 7 8 9 10

当它到达11个或更多页面时,它会在末尾附加“…”(省略号)以便对页面进行分页.十一页或更多页面看起来像:

1 2 3 4 5 6 7 8 9 10 ...

如何将其配置为不同数量的页面?我希望他们在显示“……”之前上升到25.就像是:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ...

编辑

答案在评论中.使用PagerSettings-PageButtonCount属性,它看起来像:

<asp:GridView ID="gvData" runat="server" AllowPaging=true PageSize=5 PagerSettings-PageButtonCount=20></asp:GridView>

解决方法

使用Gridview的PagerSettings-PageButtonCount属性.

例如

<asp:GridView ID="[gridname]" runat="server" AllowPaging=true PageSize=[page size] PagerSettings-PageButtonCount=[number of page buttons]></asp:GridView>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读