Problem -
Currently DataPresenterExcelExporter is not copying the color properties applied to cell like font color, background etc., to excel by default.
Workarounds -
As of now we have to follow below methods to achieve it -
1. Handle CellExporting event and get CellValuePresenterStyle of the field in it and get the properties set in that style and apply those explicitly to excel format settings.
Cons:
- Cell style applied using WPF StyleSelector at run time won't be available in CellValuePresenterStyle.
- Need to write duplicate logic of applying styles again based on cell value which we would have already take care on XamDataGrid side.
2. Set ExportFormatSettings in the XamDataGrid itself for each field.
Cons:
- Difficult in case of auto generated fields case where we are not declaring any fields under XamDataGrid.
Expected Behavior -
It will be very useful, if DataPresenteExcelExporter itself copies basic cell styles which are common to excel cell by default.
Thanks & Regards,
Siva Prakash K.