Devexpress spin - Culture info

Asked

Viewed 136 times

3

I’m using the devexpress spinedit, with MVC, it’s a decimal field, but I need the number score to be a point and not a comma, I need to put its culture as "en-US", how to do?

  • 1

    You have already tried to change the "Culture" on the web.config?

2 answers

2

If the components of the spinedit are using the . Net default, just change, preferably for the entire execution of the site, in the global.asax:

CultureInfo culture = CultureInfo.GetCultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = culture;
Thread.CurrentThread.CurrentCulture = culture;
  • And I’m voting for everything about the guy just because it was on MVP CC :D

0

It depends on the Application Type. If it is Windowforms the following is enough :

Thread.CurrentThread.CurrentCulture = New CultureInfo("pt-BR")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("pt-BR")

If it’s WPF add:

FrameworkElement.LanguageProperty.OverrideMetadata(
  GetType(FrameworkElement), 
  New FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)))

Don’t forget the Imports

Imports System.Globalization
Imports System.Threading
Imports System.Windows.Markup

Browser other questions tagged

You are not signed in. Login or sign up in order to post.