I have a gridview with a pager. The pager displays blocks of 10 page numbers (1...10, 11...20 etc.).
What I'm tryi开发者_高级运维ng to achieve is that when the user clicks on a page number, the numbers in the pager will re-align so that the selected page will be in the middle of the list. For example: If a user selects page 10, the numbers in the pager will be:
6 7 8 9 10 11 12 13 14 15
Currently, it displays:
1 2 3 4 5 6 7 8 9 10 ...
And the only way for the user to reach page 11 is to click on the 3 dots (...).
How can that be achieved?
Thanks!
Here is an article explaining how you can customize the gridview's page, http://kikosantos.net/tech/2006/05/custom-paging-in-gridview-control/. From here, you should be able to customize the paging template to make the changes you desire.
Another example of custom paging: http://dotnetslackers.com/articles/gridview/Custom-GridView-with-Paging-and-Filtering.aspx
And one more: http://www.dotnetcurry.com/ShowArticle.aspx?ID=339
精彩评论