setting decimaldigits to zero

2 posts, 0 answers
  1. Gary Blakely
    Gary Blakely avatar
    63 posts
    Member since:
    Jan 2010

    Posted 15 Apr 2010 Link to this post

    After searching over the telerik docs and then searching the internet I found a forum response indication the the method below was a way to set decimaldigits to zero for the RadNumericUpDown control (does it have to be this hard?).  The code below compiles ok but then gets a parser error when I try to run it.  It points to the xaml close /> on the globalication:NumberFormatInfo line.

    The this the best way to do it? and what's wrong with this Xaml:

     <Grid x:Name="LayoutRoot">
                    <globalization:NumberFormatInfo x:Key="NumberFormatInfo" NumberDecimalDigits="0" />

    Later on I have the following definition...

    <telerikInput:RadNumericUpDown ValueFormat="Numeric"  NumberFormatInfo="{StaticResource NumberFormatInfo}" x:Name="h1ud" ValueChanged="h1ud_ValueChanged" Width="25" Height="auto" Grid.Row="1" Grid.Column="2"/>

  2. Konstantina
    Konstantina avatar
    2332 posts

    Posted 20 Apr 2010 Link to this post

    Hello Gary,

    Thank you for contacting us.

    For now you cannot set NumberFormatInfo in XAML. This is a problem in Silverlight 3. For more information about that issue please refer to this forum post.
    However, you can set it in code behind like so:

    numeric.NumberFormatInfo.NumberDecimalDigits = 0;

    Or use the IsInteger property of the NumericUpDown control set to True.

    If you have further questions please let us know.

    Best wishes,
    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.
  3. DevCraft R3 2016 release webinar banner
Back to Top