How to export DetailsView records in expanded state from WPF DataGrid?
You can export WPF DataGrid (SfDataGrid) to excel and it is possible to process the exported excel file using XlsIO. For example, you can expand the details view records in exported excel file alone by calling Range.ExpandGroup method for worksheet.
ExcelExportingOptions exportoption = new ExcelExportingOptions(); var excelengine = datagrid.ExportToExcel(datagrid.View, exportoption); var workbook = excelengine.Excel.Workbooks[0]; workbook.Worksheets[0].Range.ExpandGroup(ExcelGroupBy.ByRows, ExpandCollapseFlags.IncludeSubgroups);
In the below screen shot, DetailsView DataGrid expanded only in excel file and not in SfDataGrid.
Samples:
Conclusion
I hope you enjoyed learning on how to export the DetailsView records in expanded state from WPF DataGrid (SfDataGrid) to Excel.
You can refer to our WPF Grid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF Grid example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!