Blazor Server App crashes when exporting TreeGrid to Exel

I have a simple TreeGrid and have added the Export to Excel option. When I click the export button, I am asked where to save the file then the file is saved but my application immediately terminates with no exception.

<SfTreeGrid @ref="_assyTree" DataSource="@TreeData" IdMapping="ChildItemID" ParentIdMapping="ParentItemID"
TreeColumnIndex="1" AllowFiltering="true" Toolbar="@(new List<string>() { "ExcelExport","CSVExport" })" AllowExcelExport="true">
<TreeGridEvents OnToolbarClick="OnTreeGridToolbarClick" TValue="NodeDto"></TreeGridEvents>
<TreeGridFilterSettings Type="Syncfusion.Blazor.TreeGrid.FilterType.Excel"></TreeGridFilterSettings>
<TreeGridColumns>
<TreeGridColumn Field="ItemNumber" HeaderText="Item Number" Width="100" TextAlign="TextAlign.Left"></TreeGridColumn>
<TreeGridColumn Field="Revision" HeaderText="Revision" Width="80" TextAlign="TextAlign.Left"></TreeGridColumn>
<TreeGridColumn Field="Description" HeaderText="Description" Width="500" TextAlign="TextAlign.Left"></TreeGridColumn>
</TreeGridColumns>
</SfTreeGrid>

The export button click hander looks like:

if ( args.Item.Text.Equals( "Excel Export" ) )
{
ExcelExportProperties exprop = new ExcelExportProperties();
exprop.FileName = $"{_parent.ItemNumber}_BOM.xlsx";
await _assyTree?.ExportToExcelAsync( exprop );
}
else
{
if ( args.Item.Text.Equals( "CSV Export" ) )
{
await _assyTree?.ExportToCsvAsync();
}
}

This is what I see:

Image_5831_1780045039692

The console window says:

(process 18808) exited with code -1 (0xffffffff).


The Excel file created opens fine.


Can you help?

Andy


Loader.
Up arrow icon