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

RadNumericUpDown.NumberFormatInfo: Globalization is an unknown namespace

4 Answers 164 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
ADM-IT Denis Pujdak
Top achievements
Rank 1
ADM-IT Denis Pujdak asked on 16 May 2014, 03:28 PM
 

My xaml generates an error:

<UserControl
xmlns:globalization="clr-namespace:System.Globalization;assembly=mscorlib">
                                                  
  
<telerik:RadNumericUpDown Value="{Binding adeYearManufacture, Mode=TwoWay, ValidatesOnDataErrors=True, ValidatesOnNotifyDataErrors=True, ValidatesOnExceptions=True}"
                                                                          NumberDecimalDigits="0" ShowButtons="False" IsInteger="True" Maximum="9999" NullValue="0" Minimum="0" Width="100" TabIndex="12" HorizontalAlignment="Left" VerticalAlignment="Top"
                                                                          IsEditable="{Binding IsPreview, Converter={StaticResource BooleanInvertConverter}}">
                                                    <telerik:RadNumericUpDown.NumberFormatInfo>
                                                        <globalization:NumberFormatInfo NumberGroupSeparator="" NumberDecimalDigits="0" />
                                                    </telerik:RadNumericUpDown.NumberFormatInfo>
                                                </telerik:RadNumericUpDown>


System.Windows.Markup.XamlParseException occurred
  Message=The type 'NumberFormatInfo' was not found because 'clr-namespace:System.Globalization;assembly=mscorlib' is an unknown namespace.

How can I set the number format???

4 Answers, 1 is accepted

Sort by
0
ADM-IT Denis Pujdak
Top achievements
Rank 1
answered on 16 May 2014, 03:29 PM
I have Telerik.Windows.Controls v.2013.3.1316.1050
0
ADM-IT Denis Pujdak
Top achievements
Rank 1
answered on 16 May 2014, 03:50 PM
http://connect.microsoft.com/VisualStudio/feedback/details/687788/xaml-parser-cannot-find-mscorlib-namespace-when-reading-enums-defined-in-system-globalization
0
ADM-IT Denis Pujdak
Top achievements
Rank 1
answered on 16 May 2014, 04:33 PM
Ok, I found solution.

public class YearNumericUpDown : RadNumericUpDown
{
    public YearNumericUpDown()
    {
        base.NumberFormatInfo = new System.Globalization.NumberFormatInfo();
        base.NumberFormatInfo.NumberGroupSeparator = string.Empty;
        base.NumberFormatInfo.NumberDecimalDigits = 0;
        base.IsInteger = true;
        base.Maximum = 9999;
        base.Minimum = 0;
    }
}
<UserControl  xmlns:ctrls="clr-namespace:MyProject.Controls;assembly=MyProject.Controls" >
 
 
                                                <ctrls:YearNumericUpDown Value="{Binding adeYearManufacture, Mode=TwoWay, ValidatesOnDataErrors=True, ValidatesOnNotifyDataErrors=True}"
                                                                          ShowButtons="False" Width="100" HorizontalAlignment="Left" VerticalAlignment="Top"
                                                                          IsEditable="{Binding IsPreview, Converter={StaticResource BooleanInvertConverter}}" TabIndex="12"/>
0
Kalin
Telerik team
answered on 19 May 2014, 07:41 AM
Hi Denis,

We are glad you have managed to resolve the issue. If you have any other questions, please do not hesitate to contact us.

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
NumericUpDown
Asked by
ADM-IT Denis Pujdak
Top achievements
Rank 1
Answers by
ADM-IT Denis Pujdak
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or