[URGENT] When null showing ___.__

10 posts, 0 answers
  1. Paolo
    Paolo avatar
    423 posts
    Member since:
    Jun 2009

    Posted 02 Apr 2012 Link to this post

    Hello,
    I've a RadMaskedNumericInput with the mask  Mask="#9.4", I want to show _____.__ when the page loads up (null value binded) but I got ____0.00 why?

    Thanks
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 04 Apr 2012 Link to this post

    Hello Paolo,

    The default value of the RadMaskedNumericInput control is 0 and this is why it is displayed when the control is initialized. But if you want to change the default Value to null, you can bind it to a nullable double business property which initial value is null. Or if you don't want to use databinding you can set the Value to null in xaml: Value="{x:Null}". Give this a try and let us know if it helps.

    On a side note, I just wanted to encourage you to take advantage of the support ticketing system (http://www.telerik.com/account/support-tickets/new-support-ticket.aspx) in cases when you need a prompt response to urgent issues. This is the best way to reach our support staff - the support system assigns a response time for all of your questions, depending on your license and ensures that all questions will reach the respective developers, if needed.

    All the best,
    Tina Stancheva
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Stephen Tearle
    Stephen Tearle avatar
    9 posts
    Member since:
    Feb 2004

    Posted 18 Apr 2012 Link to this post

    Hi,

    Binding a RadMaskedNumericInput to a nullable double? property indeed works correctly as described above... however, when binding to an int? the control displays '0' even when the bound property value is null.

    I also tried binding to float? and decimal? with the exact same result. Only double? properties appear not to default to '0' for null values.

    Is this a bug?

    Thanks,

  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 20 Apr 2012 Link to this post

    Hi Stephen,

    This is indeed a bug, so I logged it in our PITS where you can track its progress. I also updated your Telerik account for bringing this issue to our attention.

    Greetings,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Mike
    Mike avatar
    20 posts
    Member since:
    Aug 2011

    Posted 03 May 2012 Link to this post

    Good Morning,

    I am having the same issue. Could you please indicate when this bug will be fixed?

    Thanks,

    Mike
  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 03 May 2012 Link to this post

    Hello Mike,

    We will do our best to fix this issue for the Q2 2012 official release scheduled for the middle of June. I hope this time-frame is acceptable for you.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Mike
    Mike avatar
    20 posts
    Member since:
    Aug 2011

    Posted 03 May 2012 Link to this post

    Hello Tina,

    Thanks for letting me know. At the moment I am working round the issue by using an int? to double? converter but It would be great if this could be included in Q2 as it's not the prettiest solution.

    Thanks,
    Mike
  9. Ankur
    Ankur avatar
    6 posts
    Member since:
    Sep 2012

    Posted 06 Jan 2015 in reply to Tina Stancheva Link to this post

    Hi Tina,

    Is this issue resolved? I am facing a similar situation with RadMaskedNumericControl where I am binding it to a nullable decimal and it is displaying 0 instead of blank.

    I am using v2013.3.1204.45

    Thanks,
    Ankur
  10. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 09 Jan 2015 Link to this post

    Hi Ankur,

    The logged issue is marked as resolved but actually we have not introduced any changes in our code. Thi is because the RadMaskedNumericInput's Value property is of type nullable double (Double?) and when it is bound to nullable Int there is no framework mechanism to automatically match the null value from the set (null or decimal} to the property's type value (null or double). This is why 0 is displayed - the default value of the MaskedNumericInput's Value which is dependency property.

    To resolve this you can change the bound value's type to nullable Double. You can also consider using RadMaskedCurrencyInput which Value's type is nullable Decimal or use an IValueConverter that converts the Decimal? from your view model to Double? and vise versa.

    I hope this helps.

    Regards,
    Martin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  11. Ankur
    Ankur avatar
    6 posts
    Member since:
    Sep 2012

    Posted 09 Jan 2015 in reply to Martin Link to this post

    Thanks Martin for coming back, I resolved it using a converter.

    Best,
    Ankur
Back to Top
UI for WPF is Visual Studio 2017 Ready