Print Page | Close Window

Telerik Paging + Cocktail

Printed From: IdeaBlade
Category: Cocktail
Forum Name: Community Forum
Forum Discription: A professional application framework using Caliburn.Micro and DevForce
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4226
Printed Date: 15-May-2025 at 1:22am


Topic: Telerik Paging + Cocktail
Posted By: smi-mark
Subject: Telerik Paging + Cocktail
Date Posted: 15-Jul-2013 at 6:39pm
If anyone is interested in paging with the RadDataPager and Cocktail, here is something I threw together for a project:

uploads/449/PagedItemsCollection.txt - uploads/449/PagedItemsCollection.txt

This is an example of how I used it:


            _pager = _unitOfWork.Products.Pager(new SortSelector(typeof(Product), Product.EntityPropertyNames.UPC), 100);
            Products = new PagedItemsCollection<Product>(_pager);


Products is defined on my repository as a IPagerRepository<Product>

In order to return the true item count / page count, it needs to be initialized using the Initialize() method on the collection. This gets the last page, and then goes to the first page in order to populate the required fields.

In your xaml you can simply do something like:


<telerik:RadDataPager Source="{Binding Products}"/>


Hope this helps someone!




Replies:
Posted By: cypher
Date Posted: 16-Jul-2013 at 1:20am
Hi Mark,

thanks for Sharing... i will start to implement paging in near future.. this is a good startingpoint. 


Posted By: smi-mark
Date Posted: 16-Jul-2013 at 6:09am
Great, hope you find it useful. I've made some further changes to allow changing the pager on the collection. I'd like to look at supporting the telerik filtering / sorting but I haven't really looked at what's involved in that yet.


Posted By: cefernan
Date Posted: 16-Jul-2013 at 11:39am
I have an adapter for IPager too.

Maybe can be useful to you.

uploads/1485/PagedCollectionViewAdapter.txt - uploads/1485/PagedCollectionViewAdapter.txt

Regards.


Posted By: gregweb
Date Posted: 22-Aug-2013 at 10:09am
Hi Mark,

This looks good, am going to try it out.

Greg



Print Page | Close Window