The value of the FileName parameter is not updated properly in the OnBeforeExport event handler.
Hi all,
Changing the name of the file with the following code:
<GridExcelExport FileName="@FileName" OnBeforeExport="@(()=> { FileName="test"; } )"/>
is not something that was intended to work (thus it worked by chance). The reason for this is that in order for the modified variable to be applied, a render cycle in the Blazor framework should happen while the "OnBeforeExport" event is happening, which is something that is not recommended.
Instead of making a "fix" for the workaround, we will probably consider exposing a "FileName" argument in the "OnBeforeExport" event, so that it can be overridden just like you can change the data or the columns.
Regards,
Stamo Gochev
Progress Telerik
Hello Ted,
Indeed, the link was broken. Thank you for bringing this to our attention!
I have edited the Bug report description, and now the link should work correctly.
Regards,
Yanislav
Progress Telerik