# Export DataGrid with multiple DataSources

**URL:** <https://forum.radzen.com/t/export-datagrid-with-multiple-datasources/6352>\
**Category:** Blazor WebAssembly\
**Created:** [January 19, 2021, 9:12am UTC](https://forum.radzen.com/t/export-datagrid-with-multiple-datasources/6352 "2021-01-19T09:12:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.f](https://forum.radzen.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@chris.f](https://forum.radzen.com/u/chris.f)\
**Post date:** [January 19, 2021, 9:12am UTC](https://forum.radzen.com/t/export-datagrid-with-multiple-datasources/6352/1 "2021-01-19T09:12:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [January 19, 2021, 9:16am UTC](https://forum.radzen.com/t/export-datagrid-with-multiple-datasources/6352/2 "2021-01-19T09:16:50Z")

</div>

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:

> **[Customizing generated application (Blazor) (Blazor)](https://www.radzen.com/documentation/blazor/customizing-generated-application/)**
>
> How to customize the code which Radzen generates for your Blazor application.

---

<div class="post-metadata">

**Author:** ![chris.f](https://forum.radzen.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@chris.f](https://forum.radzen.com/u/chris.f)\
**Post date:** [January 19, 2021, 9:29am UTC](https://forum.radzen.com/t/export-datagrid-with-multiple-datasources/6352/3 "2021-01-19T09:29:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RIProG](https://forum.radzen.com/user_avatar/forum.radzen.com/riprog/32/8494_2.png) [@RIProG](https://forum.radzen.com/u/RIProG)\
**Post date:** [February 7, 2022, 10:21am UTC](https://forum.radzen.com/t/export-datagrid-with-multiple-datasources/6352/4 "2022-02-07T10:21:22Z")

</div>

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 🙂

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!

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [February 7, 2022, 12:30pm UTC](https://forum.radzen.com/t/export-datagrid-with-multiple-datasources/6352/5 "2022-02-07T12:30:40Z")

</div>

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:

 ![image](https://forum.radzen.com/uploads/default/original/2X/0/027fc81ee13015e76a9adfc8c0c4c0284c353a18.png)

extend the service to call the export controller custom method:

 ![image](https://forum.radzen.com/uploads/default/original/2X/c/cd937f75352668de43076b8bcc94d5b6b088ef36.png)

and execute the custom service method when needed:

 ![image](https://forum.radzen.com/uploads/default/original/2X/1/1da16698073ce6341bfa8578b9667da619350e8a.png)

try the result:

 ![image](https://forum.radzen.com/uploads/default/original/2X/2/2a3155c92e9ae4ccc2b352206e32c6f3586aca5b.png)

 ![image](https://forum.radzen.com/uploads/default/original/2X/2/2a811b9dc1d50c1672689151cb446a6e97bf7631.png)

---

<div class="post-metadata">

**Author:** ![RIProG](https://forum.radzen.com/user_avatar/forum.radzen.com/riprog/32/8494_2.png) [@RIProG](https://forum.radzen.com/u/RIProG)\
**Post date:** [February 7, 2022, 2:34pm UTC](https://forum.radzen.com/t/export-datagrid-with-multiple-datasources/6352/6 "2022-02-07T14:34:42Z")

</div>

Thanks for taking the time to give an example @enchev 🙂
