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

Single to Double Conversion Error in VB.Net?

1 Answer 67 Views
DataBar
This is a migrated thread and some comments may be shown as answers.
Berney
Top achievements
Rank 1
Berney asked on 17 Jun 2013, 01:46 AM
I'm attempting to bind a floating point single (type is Single in VB.Net) to the value of databar and getting an error that a conversion cannot be made from Single to Double?

I've not experienced this with other controls.

A single is required in this case because the object is serialized and compressed. Using a single saves disk space.

Further, I need to provide the type Object to the Value property because in some cases I'm providing an Int32, whereas other times I am providing a Single. This is done via a datatemplate in a GridView.

It seems that if I provide anything pother than a double, the RadDataBar throws exceptions?

Am I overlooking something?

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 20 Jun 2013, 08:21 AM
Hello Berney,

In this case, you can specify a Converter in your Binding expression that will do the necessary logic to provide the Value property with the expected double value. For additional information on Converters, please refer to MSDN.

Regards,
Tsvetie
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DataBar
Asked by
Berney
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or