I have a method to return a group of objects as a generic list which I then bind to a Repeater. I want to implement paging on the repeater using the PagedDataSource class but I’m not sure that this is possible as it doesn’t seem to work.
Will I have to change the return type of my method or is it possible to bind the PagedDataSource to the generic list?
I’ve just modified some of my code to use a generic list and seems to have worked fine, hope this helps:
Note that this entire method can be called with or without a page number to automatically set the page, it also builds a paging control inside of a panel calling PagingPanel.
The line that sets the DataSource on the PagedDataSource instance (dataSource) did take an array of NewsItems (searchResults), I’ve updated it to consume a List that’s created using the NewItem array.