When I use EditorTemplate in a grid inside ClientDetailTemplateId I get "Invalid template" error due to
1. In EditorTemplate you cannot use # or you should double it ## this is clear
2. I need to user kendo control in EditorTemplate and I try to use ToClientTemplate() so kendo convert html for valid for EditorTemplate like
@Html.Kendo().DropDownListFor(m => m.Person).ToClientTemplate()
But I still get error because kendo clause above converts into
<input id="Person" name="Person" style="width:100%;" type="text" value="" />
<script>jQuery(function(){jQuery("#Person").kendoDropDownList({"autoBind":true,"dataTextField":"FullName","dataValueField":"PersonId","dataSource":{"transport":{"read":{"url":"/Administration/Students_Read","data":function() { return kendo.ui.DropDownList.requestData(jQuery("#Person")); }},"prefix":""},"serverFiltering":true,"filter":[],"schema":{"errors":"Errors"}}});});</script></div>' Generated code:'var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;with(data){$kendoOutput='<input data-val="true" data-val-required="The RegisterGroupId field is required." id="RegisterGroupId" name="RegisterGroupId" type="hidden" value="" /><div class="k-edit-label"> <label for="Person">Person</label></div><div class="editor-field"> <input id="Person" name="Person" style="width:100%;" type="text" value="" /><script>jQuery(function(){jQuery("';Person").kendoDropDownList({"autoBind":true,"dataTextField":"FullName","dataValueField":"PersonId","dataSource":{"transport":{"read":{"url":"/Administration/Students_Read","data":function() { return kendo.ui.DropDownList.requestData(jQuery(";$kendoOutput+='Person")); }},"prefix":""},"serverFiltering":true,"filter":[],"schema":{"errors":"Errors"}}});});</script>
I believe problem in jQuery("#Person") having hash. But it is a kinda result of ToClientTemplate() where I expect proper template for ClientTemplat
I can workaround it using onEdit event of I grid and using kendo UI manually to make kendo control
(like <input id="Person" name="Person" style="width:100%;" type="text" value="" /> in EditorTemplate and JQuery in onEdit) but it is a inconvenience. Whole thing of kendo for mvc in ability to use mvc control in view