I'm trying to export some SfDataGrid to Excel using the ExportToExcel extension method. Since I'm using a base class as exporter, is there a way to export the SfDataGrid along with its styles? The CellExporting event allows only styling based on CellValue/CellType, so instead of having different options_CellExporting listener (see snippet below), is it possible to have something similar to the FindResource method in WPF that can get all of the cell style and apply them on the exported Excel? How to export the SfDataGrid to Excel with styles | WPF - SfDataGrid (syncfusion.com)
var options = new ExcelExportingOptions(); options.CellExporting +=options_CellExporting;
We have checked the feasibility to achieve your requirement. In that, with the WinForms, we do not have any equivalent ways to export the Styles as you mentioned. However, you can export the SfDataGrid along with all the applied styles. Currently, ExportToExcel does not export the Datagrid along with the applied styles. We have logged this as a bug “Applied styles do not export properly while exporting the SfDataGrid to Excel” We will include this fix in our NuGet release which is scheduled on January 03, 2023.
You can track the status of this report through the
following feedback link,
Note: The provided feedback link is private, and you need to log in to view this feedback.
We appreciate your patience until then.
We are unable to include the fix for this issue in our NuGet package which is released today. We will fix this issue and include it in our Weekly NuGet release scheduled for January 10, 2023. We appreciate your patience until then.
We would like to let you know that Essential Studio Weekly NuGet packages (v220.127.116.11) have been published in nuget.org with the fix for the issue “Applied styles do not export properly while exporting the SfDataGrid to Excel”. Please let us know if you have any concerns about this.