ASP.NET GridView numerical paging with unlimited page numbers

I have a GridView with paging enabled, and PageSettings mode is "Numeric". This setting is currently displayed correctly for ten pages or less:

1 2 3 4 5 6 7 8 9 10 

When it reaches eleven or more pages, it adds a “...” (ellipsis) at the end to abstract the pages. Eleven or more pages are as follows:

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

How do I set this to a different number of pages? I want them to rise to 25 before showing "...". Sort of:

 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 ... 

EDIT

The answer is in the comments. Use the PagerSettings-PageButtonCount , which will look something like this:

 <asp:GridView ID="gvData" runat="server" AllowPaging=true PageSize=5 PagerSettings-PageButtonCount=20></asp:GridView> 
+4
source share
1 answer

use the PagerSettings-PageButtonCount property of the Gridview.

eg

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

All Articles