我有一个启用了分页的 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/