How can I honor other cultures using C1Flexgrid?

Posted by: terry.stringer on 20 October 2021, 12:43 pm EST

    • Post Options:
    • Link

    Posted 20 October 2021, 12:43 pm EST

    I’ writing a desktop application using C1Flexgrid. The application crashes when being deployed in other cultures, where they use decimals instead of commas, or both in numerical formatting. How can I ensure the application adapts to other regions without breaking? Thanks!

  • Posted 21 October 2021, 3:21 am EST

    Hello,

    It may be possible that in some part or in control the culture is not applied, like in ValueConverters we can set specific Culture.

    Could you please provide the StackTrace, that will be helpful.

    Regards,

    Nitin

  • Posted 21 October 2021, 10:55 am EST

    Thanks for the reply. I know that the culture is not being applied, that’s my problem and my question. How CAN the culture be applied? It is not possible to get a stackTrace as this is on a customer’s computer in a different country, culture.

  • Posted 22 October 2021, 6:24 am EST

    Hello,

    You can set culture on a specific control content, for e.x., you can set culture on content of a Label control as:

    
    double value = 20.5;
    CultureInfo deCulture = new CultureInfo("de-DE");
    lbl.Content = value.ToString("N2", deCulture);
    
    

    Or you can also change the Culture for whole application by putting the below code in MainWindow’s constructor :

    
    CultureInfo deCulture = new CultureInfo("de-DE");
    Thread.CurrentThread.CurrentCulture = deCulture ;
    Thread.CurrentThread.CurrentUICulture = deCulture;
    
    

    JFYI, The CurrentUICulture is relevant if your application supports multiple languages.

    Regards,

    Nitin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels