We help IT Professionals succeed at work.

How to implement Custom gridview paging

Sukeshjph asked
Currently i want to accomplish custom paging in my gridview.Initially i was doing it by Default paging.In google i can get only objectdatasource control but i want it through the use of dataset.How to set a page number in the textbox field and then through dropdownlist i can go to the required page.
Watch Question

You need to define a class and use your dataset inside the class to implement custom paging.
Then you just need to use a object datasource and use your own class as the datasource for object datasource.
For more detailed information, study Pro ASP .NET 2 by Matthew McDonald, Apress.
Hi Sukeshjph,

Here are a few articles that explain (with source code) how you can implement your custom pager:
 - http://kpumuk.info/asp-net/gridview-with-custom-digg-like-pager/
 - http://www.dotnetbips.com/articles/7684926d-dd3e-493e-80df-ace8863245e0.aspx

I hope this will help you.



Can i not achieve my objective to set the custom page index through only onrowcreated and onrowcommand event of the gridview if i am not required to use objectdatasource control for this.

We have dataacess layers which returns us dataset.

What i think i can simply put one textbox...at runtime somebody type the pagesize and from another dropdownlist (both present in the pager template )i can select which page out of available pages i want to navigate directly.

I think I understand now what you need. Please check this article that explains how you can implement such custom paging: http://www.codeproject.com/KB/aspnet/GridViewNeatPaging.aspx


thank you i think i have got my solution.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.