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

Bug? NumberDecimalSeparator

3 Answers 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alessandro
Top achievements
Rank 1
Alessandro asked on 05 Feb 2015, 12:55 PM
For our application we need to support several languages.

I want to have the user defined decimal symbol for every language.

In my case it's DE-CH. I've change the Decimal separator to Comma:


On start up, I'm modifying the CurrentCulture and the CurrentUICulture to use the windows defined:
    System.Globalization.CultureInfo useCult = System.Threading.Thread.CurrentThread.CurrentCulture; 
     System.Globalization.CultureInfo neplCult = new System.Globalization.CultureInfo("En-US");
     neplCult.NumberFormat = useCult.NumberFormat;
     System.Threading.Thread.CurrentThread.CurrentCulture = neplCult;
     System.Threading.Thread.CurrentThread.CurrentUICulture = neplCult;
First I take the start up culture to have the correct number format. After that I create the english default culture, but I'm replacing the Number Format to have the Swiss Number Format.
If I'm checking now a text box, it still has a point as decimal separator. Why that? I checked the CurrentCulture and the CurrentUICulture. The Comma is defined and not a point.

If I do the same thing with the DateTimeFormat. The controls are showing the German Months?

Is this a Bug or I'm doing something wrong?

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 10 Feb 2015, 09:52 AM
Hello,

As I understand when you apply the custom current culture, then a TextBox instance does not respect it. Is this correct or do you also use any of the controls from the UI for WPF suite? In case other controls are also involved, would you please share some more details on them?

I tested the case against our RadGridView and the correct numeric format was respected as following the instructions from the How to apply a custom format settings through the CurrentCulture article.

As to the TextBox itself, I can suggest you checking a blog on:
Implementing Two-way Binding of a Numeric Value to a String (such as TextBox.Text).

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Alessandro
Top achievements
Rank 1
answered on 17 Feb 2015, 10:15 AM
Hi Dimitrina

Thank you for the answer. For the RadGridView I missed the IsLocalizationLanguageRespected. I'm wondering, how all the other Telerik controls will handle this custom format settings in the culture?

For the normal TextBoxes probably I need to think about the Two-way Binding.

Regards,

Alessandro
0
Dimitrina
Telerik team
answered on 17 Feb 2015, 01:48 PM
Hello Alessandro,

Regarding details on all other Telerik controls, you can refer to the documentation of any specific control you are interested in.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Alessandro
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Alessandro
Top achievements
Rank 1
Share this question
or