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

[Solved] DataMemberBinding using Converter to translate values

2 Answers 254 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jim
Top achievements
Rank 1
Jim asked on 05 Aug 2009, 07:05 PM
I have defined the following in my grid:

<telerikGrid:GridViewDataColumn HeaderText="Frequency" DataMemberBinding="{Binding FrequencyID, Converter={StaticResource FrequencyConverter}}">

The purpose of the FrequencyConverter is to take a FrequencyID and turn it into a string value (simple key, value type lookup).

I was expecting that the result of this would be that the when I drag the frequency column to the group header it would show the 'converted' values.  As it is I am seeing the value of the FrequencyID.  

I don't have a particularly good way to debug this, however, I did put a breakpoint in my IValueConverter and noticed that the code is being executed.

Any thoughts? Should I simply be taking a different approach?

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Aug 2009, 06:33 AM
Hi Jim,

RadGridView will execute operations like sorting, grouping, filtering, etc. directly on your data-source (grid ItemsSource) - converters are used only for UI purposes (formatting values, etc.).

All the best,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jim
Top achievements
Rank 1
answered on 06 Aug 2009, 01:35 PM
OK, I can work with that. It seems odd that you chose binding syntax in that case. It seems by your description that a DataMemberPath would be a more apt property name.
Tags
GridView
Asked by
Jim
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Jim
Top achievements
Rank 1
Share this question
or