Add paging buttons to gridview pagersetting set to Numeric

1.3k views Asked by At

I'd like to implement paging on my gridview control. I'd like it to look like this

First Previous 12345...Next Last

Unfortunately, asp.net's gridview doesn't support this. It only supports NextPrevious, Numeric, NextPreviousFirstLast and NumericFirstLast.

Rather than creating my own custom pager, I'd like to use the Numeric mode and just add the buttons for First, Previous, Next and Last. How do I put the buttons side by side with the numeric values if the pager is generated by asp on runtime?

1

There are 1 answers

0
M H On

You can use the PagerSettings PageButtonCount property of the Gridview.

Here is en example:

 <PagerSettings 
Mode="NextPreviousFirstLast" 
PageButtonCount="5" 
PreviousPageText="Previous" 
NextPageText="Next" 
FirstPageText="First" 
LastPageText="Last" />