how to set a label format with the current cultureinfo?

2 posts, 1 answers
  1. Marcelo
    Marcelo avatar
    28 posts
    Member since:
    Jul 2010

    Posted 21 Jun 2011 Link to this post

    Hi guys,

    I'm trying to set the format of the Guge, but I'am not having much luck...

    My application uses a "pt-BR" culture-info (set on the CurrentThread and the web.config)...
    On "pt-BR" culture-info, CurrencyDecimalSeparator and CurrencyGroupSeparator are "," and "."

    this.radialScale.Label.Format = "{0:C2}";

    give me "$ 10,000.00"  and what I want is "R$ 10.000,00"

    So, there's a way to achieve this?
  2. Answer
    Andrey avatar
    1681 posts

    Posted 23 Jun 2011 Link to this post

    Hello Marcelo,

    You can specify the Language property value in XAML code or from the code behind to "pt-BR" to get the language specific Label Format. The property is inherited by children elements. So, you can specify it for MainPage class or directly for the radial scale.
    this.Language = System.Windows.Markup.XmlLanguage.GetLanguage("pt-BR");

    this.radialScale.Language = System.Windows.Markup.XmlLanguage.GetLanguage("pt-BR");

    Andrey Murzov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top