This is a migrated thread and some comments may be shown as answers.

Kendo Export to excel Need to display detail grid column in comma separated values in excel in main grid excel export

1 Answer 45 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Mohammed asked on 19 Jun 2020, 01:22 PM


I Have a main grid and detail grid like this

i need to have the detail grid column values separated in comma in another new  columns in excel in the same row of can you please help on this.






1 Answer, 1 is accepted

Sort by
Alex Hajigeorgieva
Telerik team
answered on 23 Jun 2020, 12:57 PM

Hello, Mohammed,

To add the detail values in a separate column where their object values are comma separated, a much simpler approach can be taken.

As in the provided link:

  • read the child grid data sources beforehand so they are all available
  • in the excelExport event handler, add an additional header column cell
  • loop the rows and push the details that correspond to the current master row in a new cell

excelExport: function(e) {
          var rows = e.workbook.sheets[0].rows;       
          var masterData =;

          // add column header
            type: "header",
            value: "Details",
            color: "#fff", 
            colSpan: 1,
            rowSpan: 1

          for (var rowIndex = 1; rowIndex < rows.length; rowIndex++) {
            var masterID =[rowIndex-1].EmployeeID;
            var details =>x.EmployeeID == masterID);

            var csv ={
              return Object.values(d.toJSON()).map(function(i){ if(typeof(i)!=="object"){return i}}).filter(x=>x).join();

              value:csv[0] // I added only the first detail here as our example has a huge amount of details

Here is a runnable example for your reference:

Alex Hajigeorgieva
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Asked by
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question