Thursday, December 16, 2010

List View Control with Data Pager

ASp.net 3.5 introduced a new control Data Pager that works only with List View control for paging.It can't be used with other data controls. Data Pager is customizable we can create paging in list view using this control.We can place it anywhere on page.We can create simple next,previous or google style paging with the help of this control.

Steps to use DataPager control:-

1. Place list view on page and bind it with data.

2. Add Datapager on page.

3. Set Datapager property PagedControlID="" (It'll be the id of list view)

4. Add Page Size "or PageSize='5'"

5. Select Fields property and select paging type from available fields(Next/Previous Pager field, Numeric Pager Field or Template Pager Field)

6. so that's it.


HTML Code














Class File Code












Thanks & Regards,
Vikas Sharma

No comments:

Post a Comment