Let DoubleValue be a non primitive type wrapping a double, with a TypeConverter attached that knows how to convert it from/to a Double, and suppose a GridViewDataColumn is bound via DataMemberBinding to a property of this type. Editing the value causes an InvalidCast exception, from String to DoubleValue, in GridViewDataControl.OnKeyDown. Although the exception is captured internally, it is still visible in the Output window of VS.
Going through a ValueConverter in the DataMemberBinding does not make a difference here: the same exceptions are still raised.
The internally raised exceptions are unpleasant and can cause problems with e.g. copy/paste, which I have noted in separate post.
Going through a ValueConverter in the DataMemberBinding does not make a difference here: the same exceptions are still raised.
The internally raised exceptions are unpleasant and can cause problems with e.g. copy/paste, which I have noted in separate post.
9 Answers, 1 is accepted
0
Accepted
Hi jose,
Vlad
the Telerik team
We are using internally Convert.ChangeType() for the TextBox string value which will work with IConvertible interface. If your type is IConvertible ChangeType() will work as expected.
All the best,Vlad
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

jose
Top achievements
Rank 1
answered on 13 May 2011, 10:01 AM
What's the motivation for preferring IConvertible over TypeDescriptor in your column? Specially since as the XAML parser uses TypeDescriptor to convert Strings to values, I will have to implement both!
0
Hello,
Vlad
the Telerik team
This just is how Convert.ChangeType() will work - we are not sure however why this method will work only with IConvertible interface and not with TypeConverter.
Best wishes,Vlad
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

jose
Top achievements
Rank 1
answered on 13 May 2011, 10:21 AM
Well, if you want to find out pay a quick visit to the documentation in MSDN.
I have been looking at this and implement IConvertible is not trivial for our application. Many of our non-primitive types are F# records, which is not a class and cannot implement IConvertible in a natural way. It is still possible, but very inconvenient.
I have been looking at this and implement IConvertible is not trivial for our application. Many of our non-primitive types are F# records, which is not a class and cannot implement IConvertible in a natural way. It is still possible, but very inconvenient.
0

jose
Top achievements
Rank 1
answered on 13 May 2011, 10:42 AM
Let me insist in the implications of going through IConvertible here instead of using TypeDescriptor.
The fact that IConvertible is anti-natural to implement for F# types means that essentially any of your customers who is trying to use the RadGridView control to bind to F# values will run into this issue.
The fact that IConvertible is anti-natural to implement for F# types means that essentially any of your customers who is trying to use the RadGridView control to bind to F# values will run into this issue.
0
Hello jose,
Vlad
the Telerik team
Ok. We will do our best to provide TypeConverter support as well as soon as possible.
Best wishes,Vlad
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

jose
Top achievements
Rank 1
answered on 13 May 2011, 11:45 AM
Excellent, very appreciated. Please update this thread when a build with this issue fixed has been released.
0
Hello Jose,
Vlad
the Telerik team
Please try our Q2 2011 release and let me know how it goes.
All the best,Vlad
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
0

jose
Top achievements
Rank 1
answered on 15 Jul 2011, 09:32 AM
Brilliant! And very timely too. I will set some time apart to try the Q2 release as soon as I can.
Thanks,
Thanks,