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

Filter To Expression

4 Answers 189 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 13 Jun 2011, 05:45 PM
Hi,
I use event 'Filtered' to capture a user column filtering.

I want send this filter over the wire (WCF) to a server and call a query there.

the problem is to serialize DistinctValuesFilterDescriptor ...

Do you provide any solution how to use DistinctValuesFilterDescriptor and send it over the WCF ...

thanks in advance

Robert



4 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 14 Jun 2011, 08:58 AM
Hello Robert,

Our data engine can take a collection of FilterDescriptors and apply them on an IQueryable by appending Where clauses. We have exposed several public extension methods that can do this.

The method you are looking for is called Where. It is in the Telerik.Windows.Data.QueryableExtensions class located in the Telerik.Windows.Data.dll assembly. This method has several overload. 

What it does is take in an IQueryable and a collection of FilterDescriptors and return a new IQueryable that has them applied.

I suppose that you can create a dummy IQueryable, feed it to this method along with your FilterDescriptor and then take the Expression from the returned IQueryable.

I suppose this would do the trick.

By the way, we will release a new control in our upcoming beta called RadDataServiceDataSource. It will provide codeless integration between RadGridView, RadDataPager and a WCF Data Service. For example, when the user filters RadGridView, this will be automatically translated to the DataServiceQuery<T> and sent to the server. When data comes back, it will be automatically populated in RadGridView. This new control will be the same as the existing RadDomainDataSource, only it will work against "plain old" WCF Data Services, i.e. it will use a DataServiceContext and a DataServiceQuery.

You may check it out when the beta rolls out later this week. There will be an online example.

I hope this helps.

All the best,
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
Robert
Top achievements
Rank 1
answered on 14 Jun 2011, 02:15 PM
Hello Ross ,
Thanks for answer,

I am interested in RadDataServiceDataSource functionality,
however for this moment  I would need this dummy IQueryable .

Do you have any example of such class,
which would work with Telerik.Windows.Data.QueryableExtensions ?

best regards,
Robert
0
Rossen Hristov
Telerik team
answered on 14 Jun 2011, 02:40 PM
Hi Robert,

Unfortunately, I don't have such an example.

Take a look at this article. Of course, your implementation will not have to actually be able to do anything. An dummy IQueryable that uses a dummy IQueryProvider. The MSDN article explains the details.

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
Robert
Top achievements
Rank 1
answered on 14 Jun 2011, 03:18 PM
Hello Ross,
Well, a dummy IQueryable could be 'dummy' path ... :)
actually, what I really need is sending DistinctValuesFilterDescriptor over the WCF

There is no problem to send FilterDescriptor as it is,
but since RadGridView uses DistinctValuesFilterDescriptor and this is collection,
WCF asks me to mark this class as [CollectionDataContract] ...

What do you think?

Regards,
Robert
Tags
GridView
Asked by
Robert
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Robert
Top achievements
Rank 1
Share this question
or