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

标签 asp.net pagination

我有一个启用了分页的 GridView,并且 PageSettings 模式设置为“数字”。此设置当前正确显示十页或更少:

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>

最佳答案

使用 PagerSettings-PageButtonCount Gridview 的属性。

例如

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

关于具有无限页码的 ASP.Net GridView 数字分页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6055383/

相关文章:

asp.net mvc3 禁用母版页查看

asp.net - 在 ASP.NET MVC 3 中解码 HTML

java - 如何对 JPA 查询进行分页

pagination - Spring 启动: How to configure pagination on a @RepositoryRestResource?

swift - 如何使用 swift 和 firebase 进行分页?

c# - 在 C# Web API Web 服务中使用 Process() 调用 GhostScript

c# - 在 asp.net (C#) 的 SQL 查询中使用变量

c# - 如何获取最大http请求长度时间?

javascript - AngularJS dirPaginate 仅过滤当前页面

wordpress - 多个查询的一个分页(或如何对一个查询进行分组)