New Posts New Posts RSS Feed: Telerik Paging + Cocktail
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Telerik Paging + Cocktail

 Post Reply Post Reply
Author
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post Topic: Telerik Paging + Cocktail
    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

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!

Back to Top
cypher View Drop Down
Newbie
Newbie
Avatar

Joined: 26-Nov-2012
Location: Deutschland
Posts: 20
Post Options Post Options   Quote cypher Quote  Post ReplyReply Direct Link To This Post 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. 
Back to Top
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
cefernan View Drop Down
Groupie
Groupie


Joined: 13-Jul-2012
Posts: 70
Post Options Post Options   Quote cefernan Quote  Post ReplyReply Direct Link To This Post Posted: 16-Jul-2013 at 11:39am
I have an adapter for IPager too.

Maybe can be useful to you.


Regards.
Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Posted: 22-Aug-2013 at 10:09am
Hi Mark,

This looks good, am going to try it out.

Greg
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down