If you only need to output a particular string in a specific format then you don't need to set culture for the page. Just set culture within the String.Format as
e.Row.Cells[0].Text = string.Format(
new System.Globalization.CultureInfo("de-DE"),
"{0:MMMM yyyy}", DataBinder.Eval(e.Row.DataItem, "Month"));
Member
389 Points
965 Posts
Column of GridView in RowDataBound in german language
Sep 12, 2014 05:40 AM|cms9651|LINK
Hi there, I hope in your help.
I have problem with set language in c# application connected on a MySQL db.
The server in use is a Windows Server 2003 in english language.
I need set the output of query in first column of GridView in RowDataBound in german language.
If try the same solution in c# application the output is only english.
This is beginning to make me believe my structure as a whole is not correct.
What am I missing ?
I would greatly appreciate any help you can give me in working this problem.
My code below:
Cheers,
Chevy Mark Sunderland
All-Star
35149 Points
9075 Posts
Re: Column of GridView in RowDataBound in german language
Sep 12, 2014 08:39 AM|smirnov|LINK
If you only need to output a particular string in a specific format then you don't need to set culture for the page. Just set culture within the String.Format as
If you need to set it per page then see example of InitializeCulture() at http://msdn.microsoft.com/en-us/library/bz9tc508(v=vs.90).aspx
To set culture for entire application you could use web.config
<globalization uiCulture="de-DE" culture="de-DE" />