Is there a way to change the directory for which a kendo grid looks for popup editor template in an mvc project? Right now my grids only see the ones in editor templates folder in under the shared directory. Which works but it doesn't do anything for keeping my project organized.
3 Answers, 1 is accepted
0
Atanas Korchev
Telerik team
answered on 19 Apr 2013, 08:08 AM
Hello Chrys,
Kendo UI Complete for ASP.NET MVC relies on Html.EditorFor to determine the editor template. As far as I know the latter doesn't support different directories than EditorTemplates in ~/Views. If you find a way to modify the Html.EditorFor behavior Kendo UI Complete for ASP.NET MVC would use it.
Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
You can accomplish this by creating multiple EditorTemplates under you view folder for the controller. If you are using the templates just for views of one specific controller then you place an EditorTemplates folder under that View folder i.e under Views\Planning\ I would put a new folder EditorTemplates and put my editor templates in there. Making the location of my templates Views\Planning\EditorTemplates\MyTemplate.cshtml. The grid will look in the EditorTemplates of the planning views folder first then to the shared folder if it doesn't find the specified template.
Many thanks Chrys, that was exactly what I was looking for :-) Thought before all EditorTemplates have to be located in the Views/Shared folder which then ends in a messed folder...