I have created database of 100 items, I would like to display 10 items per page using a repeater control . User should be able to click on Next/Previous/Last/First page to get to the next / previous /last / First page.
Is this possible using a Repeater Control & Dataset?
If so, can someone tell me the steps needed to accomplish this ?
Hi!
Yes, this is possible, now dataset has new actions (Next Page/Previous page/Load more)
Also, in dataset you can set pagination - amount of items displayed on 1 page of repeater
You need repeater connected to collection, dataset (readonly), buttons bound to this dataset with correspond actions.
Last/First page can’t be accomplished without code, but it’s also achieveable
Thanks for the valuable info. I was able to add 2 buttons and link it to Next / Previous page. It works fine but seems to have very limited functionality. Also it gives an error while moving back to the top page “previousPage operation failed: DatasetError: This is the first page in the dataset”.
It seems using code is inevitable. I am trying to get the Next / Previous/ Last/ First option as per attached image. I would appreciate of anyone can post sample code to help with this.
Regarding the error message, it’s just because there are no more pages for the dataset to show, and can be disregarded.
Regarding the paging, as described on your post , the way to do it is indeed with code.
The error you encountered was raised because you clicked the “previousPage” button when you were already on the first page. In such cases, the button should be disabled - we’ll handle it.
The dataset method " setCurrentItemIndex " can be used to move the dataset to a specific item.
So moving to the first page would be moving to item index 0.
Moving to the last page would be moving to the item which is first on the last page (according to the total number of items getTotalCount and the page size you’ve defined).
Hope that’s helpful. Good luck and let us know if you need further help.