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

RIA- Use DataFilter pre-query

1 Answer 77 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Rüdiger
Top achievements
Rank 1
Rüdiger asked on 01 Mar 2011, 11:13 PM
Hi,

I wonder whether it is possible to use the datafilter pre-query instead of post-query. Is there something that could do the job?

Otherwise, I had some hope for a scenario like this:
1. Create unbound datafilter.
2. Extract query string from datafilter.
3. Send query-string to server.
4. On server use Entity-Sql.

In a recent post (http://www.telerik.com/community/forums/silverlight/data-filter/iterate-filterdescriptors.aspx) one tried to get the tree as a string, you write by using RadDataFilter.FilterDescriptors property. Is that returning an Sql-expression?

Regards,
Rüdiger

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 03 Mar 2011, 03:45 PM
Hello Rüdiger,

There are two options.

A. You can do that if you use RadDomainDataSource (WCF RIA Services) with RadDataFilter. The filtering will be performed directly on the server. Here is an online example.

In case you are interested in the new RadDomainDataSource control, here are its learning resources:
Each blog has a runnable sample project attached.

B. The other option would be to:

Create an unbound data filter. Let the user create his/her criteria through the UI. Use our extension method called Where. It is located in the QueryableExtensions class. Here is its signature:

public static IQueryable Where(this IQueryable source, CompositeFilterDescriptorCollection filterDescriptors)

So you have to pass an IQueryable and RadDataFilter.FilterDescriptors to this method.

The method will return another IQueryable which will be filtered. You can take the Expression from the IQueryable that is returned.

You will have a LINQ Expression and you can decide what to do with it from here on.

I hope this helps.

Greetings,
Ross
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
DataFilter
Asked by
Rüdiger
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or