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
35
ExcelExporter - V2011.2
posted

I have some cells that should display a different color font based on the value.  If negative, then red.  If postive, then blue. 

I know I can do conditional formatting with grid_CellControlAttached & ConditionalFormattingSettings in the grid  , however, since I am using the excelExporter to export to Excel, I am not sure how I use conditional formatting when exporting.

 I have also looked at excelExporter_ExportStarted but there is no "Appearance" property: 

e.XamGrid.Rows[i].Cells[10].Appearance.Foreground = new SolidColorBrush(Colors.Green);

and Control is null when I set it this way.

e.XamGrid.Rows[i].Cells[10].Control.Foreground

** I found a workaround by modifying the Workbook object when exporting, but it's not too elegant.  If anyone has a better way, let me know.

Thanks!

Parents
No Data
Reply
  • 21382
    posted

    If you want to change the excel style during the export you would use the cell exporting events of the exporter to change the style of the cell.   The style of grid is not copied over to the Excel spreadsheet.

     

     

Children
No Data