We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

GridWeb demo (New.Demos.2010) problem

Hi:

In the gridweb demos, there is a file CreateInvoice.aspx.cs. On the button click the function Buton1_Click is executed and a bunch of styles are set but they don't seem to actually work. So when I click the button I see the data but "Order ID" is not centered and its ForeColor, BackColor etc. don't seem to have changed. Do I have to do something special to get the demos to work properly? I believe I have 8.6.0 installed

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;

Hi,

Thanks for considering Aspose.Cells.GridWeb.

We have updated/upgraded the demos. Please have a look at them and let us know your feedback.

( https://github.com/aspose-cells/Aspose.Cells-for-.NET )