Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
615
Apply NumberFormatInfo globally
posted

Hi,

I'm developing an application using WebNumericEditors. I know how to prevent the thousands seperator from showing; applying a custom NumberFormatInfo to the editor overwriting the default one. But I really don't want to do this for each control, with the BIG possibility of overlooking one. Is there a way of applying a global numberformat to all WebNumericEditors or maybe specifying a resource or theme to fix this? I tried the theme solution, but since this isn't a real property of the editor that won't work unfortunately (as far as I know). I also found a solution on this form applying a custom numberformat object to the current running thread (using the Application_Start app.config function), but that doesn't work for some reason.

I'm using 8.2 build 2022 of the ASP.NET suite.

Parents
No Data
Reply
  • 24497
    posted

    Hi,

    I am not sure why currentthread does not work for you. You may put codes in any page event before prerender. The best is within OnLoad.

    System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
    // set your properties for ci
    System.Threading.Thread.CurrentThread.CurrentCulture = ci;

    You may look at sample applications related to culture. For example, CultureFormats.aspx.cs and CustomFormats.aspx.cs.

Children