Articles in this section
Category / Section

How to export DetailsView records in expanded state from WPF DataGrid?

1 min read

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.

Export the DetailsView record in expanded state from WPF DataGrid to excel

Samples:

WPFSample

UWPSample


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 forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied