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

2 posts, 0 answers
  1. Mohammed
    Mohammed avatar
    26 posts
    Member since:
    May 2020

    Posted 19 Jun 2020 Link to this post


    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.






  2. Alex Hajigeorgieva
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 23 Jun 2020 Link to this post

    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.
Back to Top