This question is locked. New answers and comments are not allowed.
Hello Telerik team,
If I bind my data with an IValueConverter the GridView renders fine and all data is displayed.
My problem is, that sorting, grouping or column reordering does not work.
Can you tell me please how I can bind data to the GridView with an IValueConverter and be able to have sorting, grouping and reordering?
Thank you in advance!
Greetings,
Stefan
If I bind my data with an IValueConverter the GridView renders fine and all data is displayed.
My problem is, that sorting, grouping or column reordering does not work.
Can you tell me please how I can bind data to the GridView with an IValueConverter and be able to have sorting, grouping and reordering?
Thank you in advance!
Greetings,
Stefan
4 Answers, 1 is accepted
0
Accepted
Hi Stefan,
It seems that you have stumbled upon a bug in RadGridView. Currently when you use value converter sorting and grouping do not function properly - the grid will use the original data to do the sorting, not the data that was modified by the converter.
We have logged this bug and it will be fix in a furute release. For now we can only suggest a workaround.
The workaround is pretty straighforward to implemenet: For every property that you want to have a value converter you could implement a peer 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.
Hope this works for you.
I have updated your telerik points.
Regards,
Milan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
It seems that you have stumbled upon a bug in RadGridView. Currently when you use value converter sorting and grouping do not function properly - the grid will use the original data to do the sorting, not the data that was modified by the converter.
We have logged this bug and it will be fix in a furute release. For now we can only suggest a workaround.
The workaround is pretty straighforward to implemenet: For every property that you want to have a value converter you could implement a peer 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.
Hope this works for you.
I have updated your telerik points.
Regards,
Milan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Andreas
Top achievements
Rank 1
answered on 06 Jan 2009, 09:55 AM
Hello Milan,
Thanks for your answer.
Sadly my data binding is built on the IValueConverter because the number of binding properties are changeing at runtime and therefore I cannot create a fixed object with properties to bind to. This was the reason why I used the IValueConverter in the first place.
In fact I have made your suggested workaround before - it was not my first choice, but the only way to get it working for the moment.
I am looking forward for your next release :-)
Greetings,
Stefan
Thanks for your answer.
Sadly my data binding is built on the IValueConverter because the number of binding properties are changeing at runtime and therefore I cannot create a fixed object with properties to bind to. This was the reason why I used the IValueConverter in the first place.
In fact I have made your suggested workaround before - it was not my first choice, but the only way to get it working for the moment.
I am looking forward for your next release :-)
Greetings,
Stefan
0
Tim Tos
Top achievements
Rank 1
answered on 27 Feb 2011, 07:38 PM
Hello!
Was this fixed? I am using 2010 Q3 and currently running into the same issue...
Thanks a lot,
Tim.
Was this fixed? I am using 2010 Q3 and currently running into the same issue...
Thanks a lot,
Tim.
0
Hello Tim Tos,
Maya
the Telerik team
I am sending you a sample project illustrating filtering, sorting and grouping functionalities applied on a converted values.
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!