Thanks,
blair
10 Answers, 1 is accepted
To have integers you should set NumberFormatInfo.NumberDecimalDigits = 0 in case the ValueFormat property is set to Numeric. If you want to use integers for Percentage or Currency, you should change the ValueFormat property to the appropriate one, and then set the corresponding DecimalDigits property of NumberFormatInfo to 0.
Please have a look at http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo_properties.aspx where all format options are available.
All the best,
Hristo Borisov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

1. Because I can't just set a format in XAML using a string
and
2.
<telerik:RadNumericUpDown.NumberFormatInfo>
<globalization:NumberFormatInfo NumberDecimalDigits="0"/>
</telerik:RadNumericUpDown.NumberFormatInfo>
doesn't seem to have any affect.
While it may all well and good to set the value in C# code behind, this severely limits the usefulness of the control in DataTemplate situations.
The documentation also mentions setting ValueFormat to custom, which doesn't appear to be an option in Q2 release of the controls.
Justin Taylor
I used the following XAML successfuly:
<
Window x:Class="RadComboBoxTestWpf.Window1"
xmlns:n="clr-namespace:System.Globalization;assembly=mscorlib"
xmlns:t="http://schemas.telerik.com/2008/xaml/presentation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<t:RadNumericUpDown SmallChange="1" Minimum="0" Maximum="100">
<t:RadNumericUpDown.NumberFormatInfo>
<n:NumberFormatInfo NumberDecimalDigits="0" />
</t:RadNumericUpDown.NumberFormatInfo>
</t:RadNumericUpDown>
</Grid>
</Window>
Regarding the text for setting ValueFormat=Custom - this is a mistake, that will be fixed as soon as possible.
All the best,
Valeri Hristov (Silverlight Team)
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Mine was inside a DataTemplate which seems to make the difference.
I have a sample project ready to go if you'd like me to email it to you.
Regards
Justin
Yes, please, email it to valeri at telerik dot com. I will try to respond with a solution as soon as possible.
All the best,
Valeri Hristov (Silverlight Team)
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I managed to reproduce and fix the problem. The upcoming service pack of RadControls for WPF will contain the fix. Thank you for your feedback, your points have been updated!
Sincerely yours,
Valeri Hristov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Regards
Justin
We are going to update the controls later today.
Kind regards,
Valeri Hristov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

I have a RadNumericUpDown control inside a DataTemplate, that gets selected via a TemplateSelector, and the NumberFormatInfo seems to have no effect. Is this problem back, or was it ever fixed in a non-service pack release?
Following is my XAML code block that defines the RadNumericUpDown:
<telerik:RadNumericUpDown Grid.Row="3" Grid.Column="1"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
Foreground="Black"
IsEnabled="{Binding ElementName=IsAssignedInspectorCheckBox, Path=IsChecked}"
Value="{Binding Path=Response.ResponseNumeric, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
CustomUnit="{Binding ElementName=UnitLabel, Path=Content}"
ValueChanged="NumericValue_Changed"
ValueFormat="Numeric" SmallChange="1" LargeChange="50" Minimum="0" Maximum="2000000" >
<telerik:RadNumericUpDown.NumberFormatInfo>
<globalization:NumberFormatInfo NumberDecimalDigits="0" />
</telerik:RadNumericUpDown.NumberFormatInfo>
</telerik:RadNumericUpDown>
Thanks
I had to remove some of your code in order to test the sample (the bindings to IsEnabled, Value and CustomUnit), but everything seems to work as expected. Could you please send me a simple application that can be used to observe the problem?
By the way, you could set IsInteger=true on RadNumericUpDown to achieve the same effect, without declaring NumberFormatInfo.
Regards,
Valeri Hristov
the Telerik team