Need help using Kendo UI grid in my MVC.Net application

Posted on 2018-03-13
High Priority
Last Modified: 2018-03-16
Hi Experts,
I am using a Kendo UI grid in my MVC.Net application.
I have added an onclick event to one of my grid's columns.  The event takes 1 parameter (the value of the BatchID columns).
I also want to pass the value of the FileName column a second parameter.  Is this possible to do using the template of a given column?
If so, how?

You can see my code, and an image of my code below:
    function loadLog() {
        var BatchID = $("#hdnBatchID").val();
            dataSource: {
                type: "ajax",
                transport: {
                    read: function (options) {
                            type: "POST",
                            url: '@Url.Action("GetLog", "EDI")',
                            dataType: "json",
                            data: JSON.stringify({ "BatchID": BatchID}),
                            contentType: 'application/json; charset=utf-8',
                            success: function (result) {
                                var data = result.FileDtls;
                                if (data != null)
                schema: {
                    data: function (response) {
                        return response.FileDtls;
                aggregate: [
                                { field: "Filename", aggregate: "count" },
            height: 550,
            sortable: true,
            resizable: true,
            footer: true,
            selectable: "row",
            editable: false,
            filterable: true,
            toolbar: [{ name: "excel", text: "Export to Excel" }],
            excel: { fileName: "FileDtls.xlsx", allPages: true, filterable: true },
            change: onChange,
            columns: [
                            field: "Filename",
                            title: "Filename",
                            footerTemplate: "<div style='text-align:left;color:black;'>Total Records:  #= kendo.toString(count, 'n0') #</div>",
                            field: "BatchID",
                            title: "Batch ID",
                            template: "&nbsp;<input type='button' value='#=kendo.toString(BatchID)#' class='RoundCorner' onclick='getFile(#=kendo.toString(BatchID)#)' style='width: 90px;border:0; background-color:white; 			                            color:darkblue;' />",
                            field: "ClaimCnt",
                            title: "Claim Cnt",
                            field: "PostedCnt",
                            title: "Posted Cnt"


Open in new window

Image of code (hopefully it helps illustrate what I am trying to accomplish)
Image of code to help illustrate what i want to do
Thank you very much in advance,
Question by:mainrotor
1 Comment

Expert Comment

When the event comes, work you method  "getFile(#=kendo.toString(BatchID)#)" with one parameter. Can you add the second parameter to this method?

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Join & Write a Comment

The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
Do online retailers and e-commerce sites even need to bother with the season? Is it lucrative to update and prepare your site for Black Friday and Cyber Monday shoppers? We'll find out now.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question