Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.Net GridView numeric paging with unlimited page numbers

I have a GridView with Paging enabled and PageSettings Mode set to "Numeric". This setup currently displays correctly for ten pages or less:

1 2 3 4 5 6 7 8 9 10

When it gets to eleven or more pages, it appends "..." (ellipsis) at the end to essentailly paginate the pages. Eleven or more pages looks like:

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

How can I configure this to a different number of pages? I want them to go up to 25 before showing the "...". Something like:

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 property, which would look something like:

<asp:GridView ID="gvData" runat="server" AllowPaging=true PageSize=5 PagerSettings-PageButtonCount=20></asp:GridView>
like image 990
Peach Avatar asked Oct 12 '22 00:10

Peach


1 Answers

use PagerSettings-PageButtonCount property of Gridview.

for example

<asp:GridView ID="[gridname]" runat="server" AllowPaging=true PageSize=[page size] PagerSettings-PageButtonCount=[number of page buttons]></asp:GridView>
like image 195
Tejas Shah Avatar answered Oct 23 '22 23:10

Tejas Shah