This is a migrated thread and some comments may be shown as answers.

Implementing Paging with MVVM (Prism) and RIA

3 Answers 207 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 16 Jun 2010, 04:28 AM
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

3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 16 Jun 2010, 02:36 PM
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.
0
Simon
Top achievements
Rank 1
answered on 18 Jun 2010, 01:36 AM
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
0
Rossen Hristov
Telerik team
answered on 18 Jun 2010, 08:12 AM
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
Tags
DataPager
Asked by
Simon
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Simon
Top achievements
Rank 1
Share this question
or