Peach
Peach

Reputation: 2787

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>

Upvotes: 6

Views: 8360

Answers (1)

Tejas Shah
Tejas Shah

Reputation: 41

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>

Upvotes: 4

Related Questions