Bug? NumberDecimalSeparator

4 posts, 0 answers
  1. Alessandro
    Alessandro avatar
    2 posts
    Member since:
    Jan 2012

    Posted 05 Feb 2015 Link to this post

    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?

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 10 Feb 2015 Link to this post

    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.

     
  3. DevCraft banner
  4. Alessandro
    Alessandro avatar
    2 posts
    Member since:
    Jan 2012

    Posted 17 Feb 2015 in reply to Dimitrina Link to this post

    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
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 17 Feb 2015 Link to this post

    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.

     
Back to Top