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

How to do completely custom filtering?

1 Answer 99 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jerome
Top achievements
Rank 1
Jerome asked on 12 Apr 2011, 08:31 PM
I'm trying to implement custom filtering. I need to be the one who applies the new filter options to the underlying IEnumerable/IQueryable, as I have to apply certain column filters specially for the data source.

I can't figure out how I can be made responsible for returning the IQueryable that the RadGridView ultimately uses. i'd sort of expect an event like Filtering to have a return object on the EventArgs, for me to pass the IEnumerable back to it.

I'm also completely at a loss as to how to integrate this into the DataPager. Once again, I need to be responsible for implementing the page count retrieval.

Update: I think I can do it by implementing a custom QueryProvider and IQueryable, and parsing what Telerik applies to it into my own form. This sounds hard, though. =/

It's complicated by the fact that my data model doesn't actually have real members for the things I want to query by. I sort of would rather pass them around as text keys.

For example. I'm showing a list of Person objects. Person objects have a collection of Name objects. Only one of which is the "active name." I want the First Name column's filter to be handled by formulating some custom SQL that joins to Name, eliminates all by the current one, and filters that one's FirstName property. I can easily write this code, but I can't figure out how to grab the FilterDescriptor of the FirstName column and actually apply it to the result set the RadGridView AND pager use.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 13 Apr 2011, 07:13 AM
Hello,

 I believe that this blog post may help you in your case. The solution is for Silverlight however you can use similar approach for WPF as well. 

Greetings,
Vlad
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
GridView
Asked by
Jerome
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or