export to excel specific columns
How can I avoid to export to Excel in a Net Maui Core 9 project the DataTemplate Columns ?
I found in the documentation this example
DataGridExcelExportingOption option = new DataGridExcelExportingOption();
var list = new List<string>();
list.Add("OrderID");
list.Add("Customer");
option.ExcludedColumns = list;
but the DataTemplate columns don't have a mapping name
and if I simply use these lines on the export function when the datagrid has datatemplate columns I receive a null object reference in the second line
DataGridExcelExportingController excelExport = new DataGridExcelExportingController();
DataGridExcelExportingOption option = new DataGridExcelExportingOption();
Thanks
We have reviewed your reported query and prepared a sample using the provided code snippet and information. The sample works as expected and does not encounter any crashes.
Regards,
Riyas Hameed M
Attachment: DataGridMAUI_cfd14c11.zip
It works perfectly thanks
Walter Martin,
We are pleased to hear that the provided solution is working well for you. Please feel free to reach out if you require any further assistance.
Alternatively, instead of excluding, you could build a custom export logic that only includes desired mapped columns and ignores template-based ones Sprunki Game.
Hi Sophie Raymond,
We would like to inform you that SfDataGridExport allows you to export the data displayed in the SfDataGrid. It also supports customization of the export logic based on your specific requirements.
Export to Excel in MAUI DataGrid control | Syncfusion®
Additionally, we have reviewed the link you provided, and it does not appear to be related to SfDataGrid. If you have any further questions, please feel free to ask.
Regards,
Riyas Hameed M
- 5 Replies
- 3 Participants
- Marked answer
-
WM Walter Martin
- Jun 23, 2025 10:32 PM UTC
- Jun 27, 2025 11:41 AM UTC