Wednesday, October 6, 2010

Repeater Paging - Paged Data Source

Recently I was experimenting with paging and repeaters and managed to solve it with a PagedDataSource object.

There are certain rule that come with this, however.

After instantiating a PagedDataSource object, it is PIVOTAL to set the DataSource property directly after it, before using other properties of the PagedDataSource class.

The way I implemented it was as follows.

Have 1 repeater that will contain the list of data that would like to display.

Also, I've used a repeater approach to implement the paging numbers rather than having just the 1 page number and having 2 links that will go forward and backward.

I've also maintained the page number using a public property with ViewState holding the value of the current page.

No comments:

Post a Comment