Implementing Paging with MVVM (Prism) and RIA

4 posts, 0 answers
  1. Simon
    Simon avatar
    47 posts
    Member since:
    May 2008

    Posted 15 Jun 2010 Link to this post

    Hi,

    We're developing a MVVM Prism SL app against RIA. So we're not using the DomainDataSource element in XAML.
    All the examples seem to show client side paging. With this type of paging all the records are returned from the server and the paging control simply hides the records not shown in a page.

    We want to implement server side paging so that if we have a million rows, then only the "PageSize" number of records are returned.

    It also appears that setting a GroupDescriptor in XAML does not work if paging is implemented, without paging it works fine. Additionally it does appear that the PageSize is not respected if the user manually groups by a column when paging is implemented. Can you check this?

    Can you give me an example of how server paging should work against a RIA DataContext when using the MVVM pattern, using your DataGrid? Also how will it work if Grouping is implemented.

    Thanks
    Simon

  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 16 Jun 2010 Link to this post

    Hi Simon,

    For more information about RadDataPager, please read my blog post. It contains many sample projects. One of them is with a DomainDataSource and server-side paging. You can use it as a start-up.

    Let me try to explain the paging + grouping combination. There are two different ways to do this. Group first and then page the groups or page first (i.e. get only one PageSize of data) and group over this data only.

    The first way is automatically done by RadGridView since internally it uses a QueryableCollectionView. The QCV does the grouping first and then pages over the groups. This approach has the benefit of displaying correct aggregates in the group footers.

    If the source collection, however, knows how to page first and group second, then RadGridView simply lets it do the job. Such collections are the PagedCollectionView and the DomainDataSourceView. This approach does the paging on the server, but the aggregates will not be correct, since you do not have all the data present on the client.

    So you should choose one of the two approached.

    I hope this helps.

    Regards,
    Ross
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Simon
    Simon avatar
    47 posts
    Member since:
    May 2008

    Posted 17 Jun 2010 Link to this post

    Thanks Ross,

    However as I mentioned - we're not using the DomainDataSource element in XAM, due to the fact we're using the PRISM MVVM framework.
    Do you have an example in VS2010 of how it would work using this technology?

    Thanks - Simon
  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 18 Jun 2010 Link to this post

    Hi Simon,

    We do not have a ready example for your specific case, but I am sure that if you take a look at the blog post I mentioned you will learn a lot of useful things. The blog explains about the IPagedCollectionView interface which will be central if you want to develop a custom paging implementation. Since you are not using a DomainDataSource it will be up to you to implement IPagedCollectionView and feed it to RadDataPager.

    I hope this helps.

    Sincerely yours,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top