user1414756 user1414756 - 1 month ago 25
Ajax Question

kendo mvc ajax grid sending Viewbag or ViewData variable as a parameter in client Template Column

I'm using Telerik Kendo MVC Grid ,and i need to use client template as a link.
The Question is : How to send ViewBag Variable or ViewData as a parameter within the link?

Answer

Just the syntax for creating a ClientTemplate using a ViewBag field?

@{
   ViewBag.Data = "kendo-mvc-ajax-grid-sending-viewbag-or-viewdata-variable-as-a-parameter-in-clien";
}

@(Html.Kendo().Grid<GridViewModel>()
    .Name("grid")
    .Columns(cols =>
    {
        cols.Bound(c => c.Field1);
        cols.Bound(c => c.Field2);
        cols.Bound(c => c.Field2);
            .ClientTemplate(
                "<a href='http://stackoverflow.com/questions/40106180/" + ViewBag.Data + "' target='_blank'>Click Here</a>"                    );
        })
    }
    ...rest of grid config....
)

Otherwise, you need to provide more specific details of what you are asking.

Comments