Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
xamSpreadsheet background
posted

Hello,

I'm trying to change the background of an xamSpreadsheet to have some kind of "dark" theme.

Setting the Spreadsheet.Workbook.Background or Foreground seems to have no effect.

How can I change the default background/foreground color for cells ?

Do I have to create a new theme just to change these colors ?

regards

Parents
No Data
Reply
  • 34430
    Verified Answer
    Online posted

    Hello Arnaud,

    I have been investigating into the behavior you are seeing, and the XamSpreadsheet’s Background and Foreground properties are not having any effect because the “data area” of the XamSpreadsheet is actually determined by the Workbook, and not those properties.

    For example, if you set the Workbook.Styles.NormalStyle.StyleFormat.Fill property to be Black via CellFill.CreateSolidFill(Colors.Black), this would work to color the data area of the spreadsheet. There are a bunch of other properties off of NormalStyle.StyleFormat as well that can help you to create a “theme” for your XamSpreadsheet data area.

    It is worth noting that Excel works in the same way, so if you change this on the Workbook that you are loading to the XamSpreadsheet and then save it out to Excel, it will show up in Excel in the same way that it does in the XamSpreadsheet.

    I am attaching a sample project that demonstrates the above. I hope this helps you.

    Please let me know if you have any other questions or concerns on this matter.

    SpreadsheetDarkTheme.zip

Children