asp.net-mvckendo-uigridhtml.dropdownlistforclient-templates

Adding DropDownList to kendo grid in MVC


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?


Solution

  • 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