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

Filtering and Value Converter

3 Answers 146 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 20 Apr 2012, 03:52 PM
Hi,

I have a RadGridView column to which I have applied a ValueConverter. Everyting works fine accept filtering which does not work when the Operator Filters are used as they expect the original values rather than the converted values.

For example I convert "1" to "Yes". Distinct Filters work but if I choose Show rows with value that Is equal to "Yes" then no rows are returned. If I choose Show rows with value that Is equal to "1" then the rows displaying "Yes" are returned.

I have seen a few threads on this but I would like some clarity as to where things at the current release. I realise I could re-write the view model to make the convertion but this is not ideal.

Regards,

Andy Newland

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 21 Apr 2012, 09:09 AM
Hello,

Indeed you are right. This is the expected behavior of the filtering control though. 

The actual filtering is always performed on the "raw" values, i.e. the raw '1' before it is formatted for the user's viewing pleasure. The strings that you see in the distinct values list box are just for UI purposes only. Beneath each nicely formatted string, there is the actual raw data which is used when performing filtering against the source collection.

With our latest release we have added a property called FilterMemberPath to the column class which allows you to bind to one property and filter by another property on the business object class. 

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Nayaz
Top achievements
Rank 1
answered on 01 Jun 2012, 04:33 PM
Hi,

How to use FilterMemberPath with a converter set on a column ?
The converter that I'm using returns a string but what should I write in FilterMemberPath to refer tp this string ?
I'm setting this property in code-behind in the AutoGeneratingColumn event method.

Thank you for your help.
Nayaz H.
0
Vlad
Telerik team
answered on 04 Jun 2012, 06:01 AM
Hi,

 You cannot use FilterMemberPath with converter. The best way to achieve your goal in your case is to create additional property for your data with the logic you want and set this property name for FilterMemberPath.

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Andy
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Nayaz
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or