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

Wrong DecimalSeparator on RadNumericTextBox

6 Answers 128 Views
Input
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 30 Nov 2012, 08:55 PM
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

 

6 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 30 Nov 2012, 09:58 PM
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>
0
Marc
Top achievements
Rank 1
answered on 03 Dec 2012, 02:09 PM
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.
0
Vasil
Telerik team
answered on 04 Dec 2012, 12:49 PM
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.
0
Marc
Top achievements
Rank 1
answered on 04 Dec 2012, 05:13 PM
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.
0
Vasil
Telerik team
answered on 07 Dec 2012, 09:37 AM
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.
0
Marc
Top achievements
Rank 1
answered on 07 Dec 2012, 03:32 PM
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.
Tags
Input
Asked by
Marc
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Marc
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or