RadNumericUpDown.NumberFormatInfo: Globalization is an unknown namespace

5 posts, 0 answers
  1. ADM-IT Denis Pujdak
    ADM-IT Denis Pujdak avatar
    34 posts
    Member since:
    Sep 2011

    Posted 16 May 2014 Link to this post

     

    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???
  2. ADM-IT Denis Pujdak
    ADM-IT Denis Pujdak avatar
    34 posts
    Member since:
    Sep 2011

    Posted 16 May 2014 Link to this post

    I have Telerik.Windows.Controls v.2013.3.1316.1050
  3. DevCraft banner
  4. ADM-IT Denis Pujdak
    ADM-IT Denis Pujdak avatar
    34 posts
    Member since:
    Sep 2011

    Posted 16 May 2014 Link to this post

    http://connect.microsoft.com/VisualStudio/feedback/details/687788/xaml-parser-cannot-find-mscorlib-namespace-when-reading-enums-defined-in-system-globalization
  5. ADM-IT Denis Pujdak
    ADM-IT Denis Pujdak avatar
    34 posts
    Member since:
    Sep 2011

    Posted 16 May 2014 Link to this post

    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"/>
  6. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 19 May 2014 Link to this post

    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.
     
Back to Top
DevCraft banner