Export To Excel From Grid Client Detail Expand Spreadsheet

1 Answer 74 Views
Button Grid Spreadsheet
Brian
Top achievements
Rank 1
Brian asked on 23 Feb 2022, 05:08 PM

I have a grid that contains a child detail spreadsheet.  I am trying to duplicate some code I used from another Kendo Spreadsheet, but each spreadsheet and Export button needs to have a unique id.  In the form I am using to export the Excel for the spreadsheet, I am using a Kendo Button to allow addition of the unique id (TplNum) from the parent grid.  For some reason, the template is not valid when I add the Kendo Button.  Any ideas?

I was going to use the Click event to determine the TplNum based on location of the button or the button id field in the Javascript callback, but thought that was giving me problems.  Currently, I gave the buttons a class, "export_excel" and I'm trying to create a jQuery onClick function in my document.load, which is invoked based on class, rather than id.

    $(document).ready(function () {
        $(".export_excel").click(function (e) {

        }

   }

<script id="campaign_template" type="text/kendo-tmpl">

        @using (Html.BeginForm("SpreadsheetDownload", "Campaign", FormMethod.Post, new { @class = "form-horizontal", role = "form", id = "spreadsheet_form_#=TplNum#" }))
        {
            @Html.Hidden("data", null, htmlAttributes: new { name= "data", id = "download-data_#=TplNum#" });
            @Html.Hidden("extension", null, htmlAttributes: new { name = "extension", id = "download-extension_#=TplNum#" });
            @(Html.Kendo().Button()
                    .Name("export_excel")
                    .HtmlAttributes(new { type = "button", id = "export_excel_#=TplNum#", @class = "export_excel" })
                    .Content("Export to Excel"));
                    //.Events(e => e.Click("ExportExcel")));
        }
Brian
Top achievements
Rank 1
commented on 23 Feb 2022, 05:13 PM

This is what I'm getting when the Kendo Button is not commented out:

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 28 Feb 2022, 10:17 AM

Hello Brian,

 

I am glad you've managed to resolve this issue as we discussed in the support thread.

Feel free to turn to us if new cases arise.

Regards,
Eyup
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Button Grid Spreadsheet
Asked by
Brian
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or