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

setting decimaldigits to zero

1 Answer 42 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Gary Blakely
Top achievements
Rank 1
Gary Blakely asked on 15 Apr 2010, 11:14 PM
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:
Thanks,
Gary

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

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"/>

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 20 Apr 2010, 02:08 PM
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,
Konstantina
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.
Tags
NumericUpDown
Asked by
Gary Blakely
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or