Hi All,
I got solution to show the number format in different culture.
Changes in Web.Config:
<globalization enableClientBasedCulture="true" culture="de-DE" uiCulture="auto"/>
1. culture=de-DE will set the language in which the Database will fetch the records, for e.g: if Database is of “de-DE” language then culture should be in de-DE.
2. uiCulture=auto will consider the language set in Clients browser for User Interface.
protected void Page_Init(object sender, EventArgs e)
{
System.Globalization.CultureInfo pageCultureInfo = System.Globalization.CultureInfo.CurrentCulture;
Page.Culture = pageCultureInfo.Name.ToString();
}
New Code: [Current Browser Culture will be set to Page UICulture]
protected void Page_Init(object sender, EventArgs e)
{
System.Globalization.CultureInfo pageCultureInfo = new CultureInfo(ApplicationConstants.RegionalSettings, false);
Page.UICulture = pageCultureInfo.Name.ToString();
}
Solution Status:
The Property Data type of in Class will be same as the Table field Data type
1. For Price and Weight fields
a)If data type of property is string the format is applied perfectly
b) If data type of property is double the formatting has problem
drOrder['Purchase_Price'] value is set to 1,50 in database
double dblPrice = Convert.ToDouble(drOrder['Purchase_Price'])
dblPrice shows 1.50
dblPrice.ToString() shows 1,50
when binding to coolite grid it displays 1.50 instead of 1,50
checked with forums http://msdn.microsoft.com/en-us/library/system.convert.todouble(VS.71).aspx