Adding DropDownList to kendo grid in MVC

user4092086 picture user4092086 · Jan 30, 2015 · Viewed 8k times · Source

I'm trying to add a dropdownlist to a kendo grid by the help of this documentation : http://demos.telerik.com/aspnet-mvc/grid/editing-custom

Actually I followed exactly the same way but no chance I'm wonder how the kendo grid understand it has to place a dropdownlist in the clientTemplate ?! does clientTemplate has to be defined somewhere?

Answer

Hien Tran picture Hien Tran · Jan 30, 2015

You have to define a clientTemplate by adding this to the Grid .ClientDetailTemplateId("template")
Then you can add DropDownList into the template

<script id="template" type="text/kendo-tmpl">
    @(Html.Kendo().DropDownList()
       //build the dropdownlist
       .ToClientTemplate()
    )
</script>

Demo: http://demos.telerik.com/aspnet-mvc/grid/detailtemplate