Hi,
Thanks for your posting and considering Aspose.Cells.GridWeb.
We have looked into this issue and found you need to access Cell.Style property and then reassign it and then it will work. Please see the following correct code that works fine. I have also shown the screenshot which shows it is working fine.
Please check the red lines inside the code that are most crucial.
C#
// Creates a new worksheet named “Invoice”.
GridWorksheet sheet = sheets.Add(“Invoice”);
sheet.Cells[0, 0].Value = “Order ID”;
// Sets the font size of the cell.
GridCell cell = sheet.Cells[0, 0];
Aspose.Cells.GridWeb.GridTableItemStyle style = cell.Style;
style.Font.Size = new FontUnit(“10pt”);
style.Font.Bold = true;
style.ForeColor = Color.Blue;
style.BackColor = Color.Aqua;
style.HorizontalAlign = HorizontalAlign.Center;
style.BorderStyle = BorderStyle.Double;
style.BorderColor = Color.Gold;
style.BorderWidth = 3;
cell.Style = style;