The predefined options for the GridView , which can be set through the PagerSettings.Mode property are:
- NextPrevious
- NextPreviousFirstLast
- Numeric
- NumericFirstLast
I wanted to avoid using images and tried to use the Unicode characters for 'left-pointing pointer' (\u25c4 ◄) and 'right-pointing pointer' (\u25ba ►). Also, to make it nicer, I wanted to have a TextBox in which the user can type the page he wants to go to
In the end, I decided to create a class implementing ITemplate, set the GridView's PagerTemplate to this class and add the controls I needed manually. The final result looks like this:
To use this ITemplate in a GridView, you can do something like:
myGridView.PagerTemplate = new FancyPagerTemplate (myGridView);
}
...and you're all set. The events generated by a change in the TextBox or a click on the LinkButtons and the TextBox width will be taken care of.
You can download the source code for the ITemplate from FancyPagerTemplate.cs. Feel free to customize it to your needs.
[Post Comment] | [Comments]