NumberFormatInfo not initialized in 2011Q2

5 posts, 1 answers
  1. naip
    naip avatar
    25 posts
    Member since:
    Sep 2009

    Posted 21 Jul 2011 Link to this post

    Hello,

    I have a minor problem with the RadNumericUpDown. Before the Q2-Update, the NumberFormatInfo-Property of the RadNumericUpDown was initialized and the following code run without problems...

    InitializeComponent();
    myNumericSelector.NumberFormatInfo.NumberGroupSeparator = string.Empty;

    After the Q2-Update the NumberFormatInfo-Property is null and our application crashed. It was easy to fix, but I am curious: was this change intentional and will the property be null in future versions?

    Best regards,
    Thomas
  2. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 21 Jul 2011 Link to this post

    Hello Thomas,

    Unfortunately this change is intentional and was made to avoid a problem with Blend, which always tried to serialize the property value in XAML and since NumberFormatInfo cannot be instantiated in XAML in Silverlight, this lead to invalid code... I apologize for the inconvenience.

    Best wishes,
    Valeri Hristov
    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!

  3. DevCraft banner
  4. naip
    naip avatar
    25 posts
    Member since:
    Sep 2009

    Posted 21 Jul 2011 Link to this post

    Hello Valeri,

    thank you very much for your explanation. I can definitely live with that ;)

    Best regards,
    Thomas
  5. Josh
    Josh avatar
    29 posts
    Member since:
    Feb 2009

    Posted 29 Jul 2011 Link to this post

    Is there a workaround to remove the group separator?  We have many NumericUpDowns throughout our application that are used to display a year.  We do not want a comma in the year and in previous versions this worked.

    -Josh
  6. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 01 Aug 2011 Link to this post

    Hi Josh,

    You should set the NumberFormatInfo like this:

    numericUpDown.NumberFormatInfo = new NumberFormatInfo() {
       NumberGroupSeparator = string.Empty
    };

    Kind regards,
    Yana
    the Telerik team

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

Back to Top
DevCraft banner