Single to Double Conversion Error in VB.Net?

2 posts, 0 answers
  1. Berney
    Berney avatar
    1 posts
    Member since:
    Dec 2010

    Posted 16 Jun 2013 Link to this post

    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?
  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 20 Jun 2013 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top