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

Filtering and DataPager and RIA

5 Answers 143 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 26 Jun 2010, 05:55 PM

I am using the grid and the new data pager and RIA.  The pager is bound to the items collection of the grid.

Source="{Binding ElementName=leadsDataGrid, Path=Items}"

The grid is bound to the domain data source.

ItemsSource="{Binding ElementName=leadDomainDataSource, Path=Data}"

 

 

 

 

The problem occurs when I filter the grid data using the grid FilterDescriptors collection.  The grids first page has fewer items then the other pages.  The grid filters correctly, but the rows shown on page 1 are fewer by 10 or so then page 2.  It seems the filter took them out.   Shouldn't the pager compensate and recalculate how many rows are on a page?

Bryan


 

5 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 29 Jun 2010, 09:39 AM
Hi Bryan,

What you are doing is called client-side filtering. In other words, you are performing a filter over the data that is already pulled on the client. This does not change the page-size on the server.

From your description, I think what you really need is the server-side filtering. I have prepared a blog post to explain how to develop a specialized custom filtering control that will perform filtering directly on the server, i.e. touch the FilterDescriptors of the DomainDataSource instead of the FilterDescriptors of RadGridView.

Let me know if there are problems once you have covered my blog post.

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
Andrew
Top achievements
Rank 1
answered on 21 Jul 2010, 05:10 PM
I really like your server side filtering approach.  Is there any plan to put it into either the DataPager or the DataGrid so we can turn it on with a simple parameter?
0
Rossen Hristov
Telerik team
answered on 22 Jul 2010, 03:48 PM
Hello Andrew,

We do not have such plans, as this would mean that we will couple our control with a specific implementation of a particular vendor and that is totally unacceptable.

However, we have got other plans. We are thinking of implementing our very own Domain Data Source control. Since we will be its owners we will be able to develop, improve, integrate and support it.

Until we offer such a control, the only way to communicate with Microsoft's DomainDataSource would be like shown in our numerous integration examples. In case you are not aware of them, let me know and I will provide the links.

I have added the feature request to our PITS system. You can go ahead and vote for it. Here is the link:
http://www.telerik.com/support/pits.aspx#/public/silverlight/2796

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
0
Rob Conley
Top achievements
Rank 1
answered on 01 Aug 2010, 03:27 AM
A question from a RIA/Silverlight newbie:

So if I understand this correctly, currently, setting a filter at the top of the gridview will only filter rows that the grid has already received client side, correct?  And the blog documents the current best method for passing the filter back to the server, correct?  

Otherwise, any time a filter is applied it is always being done client-side, and with a datapager in place results like the OP mentioned are to be expected?  And unless all rows were passed to the client side, the filter may be a bit misleading, correct? Sorry for the redundancy, I'm just trying to "talk" my way through this.

Rob
0
Rossen Hristov
Telerik team
answered on 02 Aug 2010, 12:42 PM
Hi Rob Conley,

Straight onto your questions.

So if I understand this correctly, currently, setting a filter at the top of the gridview will only filter rows that the grid has already received client side, correct?

You are correct. The data that the grid shows is already in-memory so this is known as client-side filtering.

And the blog documents the current best method for passing the filter back to the server, correct?

In case you are refferring to the "Pure Sever-Side..." blog, then the answer is yes. Since we cannot couple RadGridView with any particular vendor implementation, we have provided an example of how to easily filter a DomainDataSource without any of the two parties knowing about the existence of the other, i.e. RadGridView and DomainDataSource are totally clueless that they are working as a pair.

Otherwise, any time a filter is applied it is always being done client-side, and with a datapager in place results like the OP mentioned are to be expected?  And unless all rows were passed to the client side, the filter may be a bit misleading, correct? Sorry for the redundancy, I'm just trying to "talk" my way through this.

When you have a RadDataPager, it simply tells the DomainDataSource to return only a small part of the data to the client. Now, RadGridView is totally unaware of that. It simply "thinks" that its ItemsSource has only 10 items, if the PageSize is 10. That is why when you filter with the built-in RadGridView filters, you will be doing this only on these 10 records that are on the client. So you have two options -- pull all data to the client, eliminating the need of a Pager. Or you can perform server-side filtering.

Imagine that you have the following data: 1, 2, 11, 22. PageSize is 2. You will see 1,2 on the first page and 11, 22 on the second page. Now if you perform a client-side filtering (the default one) and you say "Give me all records that contain the digit 1", you will be left with one row showing 1.

Now if you perform server-side filtering saying the same thing, the data that passes the filter and comes back from the server would be 1, 11. Since your PageSize is 2 you will be seeing 1 and 11 on your only page.

I hope this makes some kind of sense. Let me know if I messed up my explanations.

Best wishes,
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
Bryan
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Andrew
Top achievements
Rank 1
Rob Conley
Top achievements
Rank 1
Share this question
or