Wrong DecimalSeparator on RadNumericTextBox

7 posts, 0 answers
  1. Marc
    Marc avatar
    39 posts
    Member since:
    Nov 2012

    Posted 30 Nov 2012 Link to this post

    What I want is to use the user decimal separator but even if I defined no specific value in the declaration of my RadNumericTextBox, it always use the "," even if my Windows is set with a ".". I also checked the decimal separator of my current culture using "Thread.CurrentThread.CurrentUICulture.NumberFormat.NumberDecimalSeparator", and the value is ".". The only way It don't have the "," is to defined a specific value.

    Here is my code:
    <telerik:RadNumericTextBox ID="RadNumericTextBox1" Runat="server" MaxValue="5" MinValue="-5" ShowSpinButtons="True"> 
        <
    NumberFormat ZeroPattern="n" DecimalDigits="1" />

    </telerik:RadNumericTextBox>

    Also, if It's required to force a decimal separator, is there a way to define it in a CSS or somewhere else to every RadNumericTextBox will use the same settings so I will not forgot one.

    Anybody can help me?

    Thanks

     

  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 30 Nov 2012 Link to this post

    Hello Marc,

    I don't really know what could be causing the problem, but if you want to force it to use the decimal point, you add a skin file and force the decimal point like that.

    Skin file:
    <telerik:RadNumericTextBox runat="server">
         <NumberFormat DecimalSeparator="." />
    </telerik:RadNumericTextBox>
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Marc
    Marc avatar
    39 posts
    Member since:
    Nov 2012

    Posted 03 Dec 2012 Link to this post

    Thanks, I already tried to force the use of the decimal point and it works but what I want to do is to use the user preference because our web page will be used by people in another country and I don't want to force them to use one Decimal Separator in particular. Also I tried the control in another PC at my office and same thing.

    But if it don't work, is there any way to specify to use the Decimal Point at only ony place so all my controls will use that settings, like with a CSS.
  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 04 Dec 2012 Link to this post

    Hi Marc,

    When no DecimalSeparator is set, the value is get from the culture settings. It will work for all clients depending on their culture.
    Note that you have to restart your computer after you change your cultural settings in order to apply it properly.

    When I use your original code, without specifying anything else, the decimal separator is ".", so it is working for English US culture.

    Greetings,
    Vasil
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Marc
    Marc avatar
    39 posts
    Member since:
    Nov 2012

    Posted 04 Dec 2012 Link to this post

    I Vasil, I confirm I am using English (United Status) with an english version of Windows 7 and also the properties of the control tell en-US as the Culture is Visual Studio 2012. I had retstarted my computer but still the same, the decimal separator is ",".

    The version of the Telerik.Web.UI.dll I am using is 2012.3.1113.45.
  7. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 07 Dec 2012 Link to this post

    Hello Marc,

    We tested on several machines, all working correct. The problem is never reported by any other of our clients so I believe there must be something in the settings of your machine.

    It is vary strange to me that the decimal separator in your culture is correct and then it appears another one. I don't know why you are facing the issue, and the information is not enough to investigate it.

    Try to debug your application further: check if the Culture for the control is the correct one on latest events like Page PreRender. Try to insulate the problem in sample page and see if it will replicate and test in different browsers. Also host the page somewhere and try to open it from different machine seeing what is the result. All the information that might not look relevant at first, can actually help to find out why the problem happens.

    Regards,
    Vasil
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Marc
    Marc avatar
    39 posts
    Member since:
    Nov 2012

    Posted 07 Dec 2012 Link to this post

    Thanks I finally found the bug ;-))) Someone has edit the web.config file and add the line "<globalization culture="fr" uiculture="en">" for test purpose. I am not sure yet what is the difference between culture and uiculture but it seem that the control use the culture to know the decimal separator while I was checking the uiculture to know the current decimal separator in debuging.

    Sorry amd thanks for your help, it was very appreciated.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017