Export DataGrid with multiple DataSources

Hi,

I'm using Radzen 2.56.12 and I'm trying to Export a DataGrid to Excel. This DataGrid combines multiple DataSources (multiple invokes) and contains a few calculated cells (using Template Property).

Is there a way to load the contents of the DataGrid to Export? Following the video tutorial it seems Export is bound to only one DataSource, but I could be mistaking.

What would be the recommended approach to achieve this?

Chris

Hi @chris.f,

At the moment this is not supported out-of-the-box. You have however full access to the source code of the ExportController and you can modify it in the way you need - just add it in the application ignore list:

Ok thank you @enchev. I will look further into that.

Hello!
Do you have any support for this by now? (loading the contents shown in datagrid to export)
In our datagrid we have templates like this:
${this.Db.GetCommaSeparatedSites(data.Id).Result.ToString()}
I would like to have same result in excel :slight_smile:

I've been checking out the ExportController.Custom but haven't figured out how i would write it there, right now we have a list for the columns like this:
$"Id as ID," +
$"Header as Header_English," +
$"IssuedBy as Issued_By_Email_Address," + ... and so on.

Hope you're having a great monday!

There are plenty of options to do that. For example you can extend the export controller for one of the data sources with custom export method that will get data from other data source as well:

extend the service to call the export controller custom method:

and execute the custom service method when needed:

try the result:

1 Like

Thanks for taking the time to give an example @enchev :slight_smile: