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

Sort by result of IValueConverter

1 Answer 151 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Geoff Smith
Top achievements
Rank 1
Geoff Smith asked on 25 Aug 2010, 01:50 PM
Is it possible to sort a GridViewDataColumn by the result of the converter rather than the object the column is bound to?

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 25 Aug 2010, 02:31 PM
Hi Geoff Smith,

There are a couple of possible approaches here. Firstly, you can sort a column according to another one by setting in xaml the Property SortMemberPath. 
Another possible approach would be to add new property that returns the modified value. For example, if you have FirstName property that you would like to modify with a converter just create a ConvertedFirstName property that will return the converted value. After that bind the grid to the Converted* properties without using DataMemberBinding and IValueConverter.
Other approach would be to handle the Sorting event and implement custom logic. You can find a sample project illustrating that solution in this forum thread.


Kind regards,
Maya
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
Geoff Smith
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or