I have a WebDataGrid with a date editor and a currency editor. When I try to set the date it returns as a US formatted date even tho I have forced the culture into en-GB. The currency editor displays the $ symbol too. I have set the DataFormatString to {0:d} for dates and {0:c} for currency.
I have confirmed the culture has been set to en-GB but the controls seem to ignore it.
Version: 2011.1
Sorry the post looks mucked up but you can copy and paste into notepad and get the full code.
Hi Elizabeth
That done the trick thank you.
Just incase some one else wants to know how to set this up follow these steps:
Override the InitilizeCulture method on the page like so:
Protected Overrides Sub InitializeCulture() Dim overrideCulture As String = "en-GB" UICulture = overrideCulture Culture = overrideCulture Thread.CurrentThread.CurrentCulture = New CultureInfo(overrideCulture) Thread.CurrentThread.CurrentUICulture = New CultureInfo(overrideCulture) End Sub
You may want to create a base class and get each page to inherit from that making sure each page overrides the culture information.
Now modify your script manager like so:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true"> </asp:ScriptManager>
You can also setup the globalisation is the web config like so:
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-GB" uiCulture="en-GB"/>
Hello RichBamford,
Please refer to this forum post. It sounds similar to what you are experiencing. If it is not helpful, please let me know how you are trying to set the date, and how you have forced the culture into en-GB.
Elizabeth AlbertLocalization Engineer