0

Is it possible to create a custom Pager for the GridView control of ASP.NET that looks liek this? Pager

If so, can anyone give me some ideas or some starting code into how to create it?

Thank you.

Omtara
  • 2,911
  • 2
  • 19
  • 31
Eric Bergman
  • 1,453
  • 11
  • 46
  • 84
  • Do you want to alter only the visuals or are you after some radical behavioral changes to the pager? – walther Aug 14 '12 at 22:45
  • The Next and Previous have to be Buttons or Image Buttons and it has to have a similar format to this one with the same styling but I cannot achieve this with the Default Pager that comes with GridView. – Eric Bergman Aug 14 '12 at 22:47
  • @codingbiz I have tried to create something using PagerSettings and PagerStyle but I was not able to create something that functions and looks like this. I was wondering if there's anyway to create something similar to this using Custom Grid View Pagers if so, can you give me some hints or some code to get me started? – Eric Bergman Aug 14 '12 at 22:49
  • 1
    What exactly have you tried so far? Because this should be easily achievable with the embedded pager, just by altering few css rules... – walther Aug 14 '12 at 22:53
  • But the default pager doesn't have "Previous" and "Next" it only has the following modes: Numeric NumericFirstLast NextPrevious NextPreviousFirstLast Is there any other way to do this? Custom Templates? or maybe PagerTemplate? – Eric Bergman Aug 14 '12 at 23:22
  • This link should help you [Custom Paging in GridView](http://www.codeproject.com/Tips/402965/Custom-Paging-in-GridView) and [GridView Custom Paging](http://www.codeproject.com/Articles/16238/GridView-Custom-Paging). Search StackOverflow and google for similar question – codingbiz Aug 14 '12 at 23:40
  • I want to do something similar to this: http://www.asp.net/community/recognition/hall-of-fame Previous 1 2 3 4 5 ... 99 Next – Eric Bergman Aug 15 '12 at 02:08

1 Answers1

1

You just need fixed LinkButtons for previous & next and a LinkButton inside a Repeater control for the individual pages.

Have a look at this page for details: Custom Paging with the ASP.NET Repeater control

Omtara
  • 2,911
  • 2
  • 19
  • 31
  • Thanks for the suggestion but I'm using an ObjectDataSource in my grid view so I cannot use stuff like Repeater1.DataSource = page Repeater1.DataBind() in my code behind, do you have an idea of how to create this using custom templates or manybe PagerTemplate ? Thankyou. – Eric Bergman Aug 14 '12 at 23:25