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

GridViewHyperlinkColumn and Filtering

2 Answers 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eric Schoenholzer
Top achievements
Rank 2
Eric Schoenholzer asked on 04 Sep 2010, 02:18 AM
Hi, my GridViewHyperlinkColumn  the DataMember is bound to the URL-Field and the Content to a Name-Field (shown as text).
SortMemberPath is also set to the Name.

When I use the filter, GriedView tries to filter after the URL (DataMember).
Is there a way to use the Name-Field as value to filter?
No property named "FilterMemberPath" ?

Thanks
Eric

2 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 06 Sep 2010, 08:46 AM
Hi Eric Schoenholzer,

Your best option would be to implement a Custom Filtering Control like demonstrated in this blog post.

There is another option, which is not so "clean". You can attach to the DistinctValuesLoading event of the grid. For the hyperlink column you can replace the default distinct values, i.e. the URL's with their respective friendly names. This will populate the distinct values text-box with the friendly names.

Now since the underlying data is actually the URL, you will have to attach to the Filtering event of the grid and manually change the value of the filter descriptor back to the URL It will come as the friendly name, i.e. the thing from the distinct values list box and you will change it back to the URL.

Yet another option which you can try is to add an IValueConverter to the column Binding. The default filtering control will respect the IValueConverter and show whatever it returns.

I hope this helps. Let me know if it does not.

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
0
Pierre
Top achievements
Rank 1
answered on 21 Sep 2011, 05:30 PM
Hi Ross,

    Can you send code snippets for options 2 and 3.

    Thanks
Tags
GridView
Asked by
Eric Schoenholzer
Top achievements
Rank 2
Answers by
Rossen Hristov
Telerik team
Pierre
Top achievements
Rank 1
Share this question
or