Hi Scott,
Thanks for your posting and using Aspose.Cells for GridWeb.
You do not need to set the Region or Culture from Control Panel. You can set it in run time. The following code sets the Region or Culture of the Thread to Dutch.
Now the region or culture of your thread will be set to Dutch even if the culture or region of your computer or control panel is set to USA.
C#
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(“nl-NL”);
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(“nl-NL”);
Please see the following sample code. It renders value
123456 inside the GridWeb according to Dutch culture i.e
123.456,00 as shown in this
screenshot.
C#
if (Page.IsPostBack == false && this.GridWeb1.IsPostBack == false)
{
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("nl-NL");
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-NL");
Aspose.Cells.GridWeb.TableItemStyle style = new Aspose.Cells.GridWeb.TableItemStyle();
WebWorksheet sheet = GridWeb1.WebWorksheets[0];
sheet.Cells["A1"].PutValue(123456);
string NumberFormat = "#,##0.00";
style.HorizontalAlign = HorizontalAlign.Right;
style.Custom = NumberFormat;
style.Font.Bold = true;
sheet.Cells[0, 0].SetStyle(style);
}