"EditorTemplate" folder not working

4 posts, 0 answers
  1. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 03 Nov 2015 Link to this post

     For some unknown reason I can't seem to get my EditTemplates to work if I have them in a folder named "EditorTemplates" in the same folder as my view containing the Kendo UI Grid (MVC) but if I put the same file in Shared/EditorTemplates it works. If I look at this example the Edit Template is setup as indicated above but is working (I guess). 

    https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/custom-popup-editor/KendoUIMVC5/Views/Home

     

    What do I need to do to get it to work from an EditorTemplates folder in same folder as my main view?

  2. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 03 Nov 2015 in reply to Patrik Johansson Link to this post

    Have now tried to run the demo on my computer and it seem to work with the Editor template in an "EditorTemplates" folder in the same folder as the view. But I have been unable to get my project to work even though I can't find any relevant difference in code, setup etc. I'm guessing this is probably some kind of configuration issue but can't figure out what it could be?

     

    Again, when I move my Editor template to "Shared/EditorTemplates" it works fine, so the files themselves and their contents should be fine.

  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 05 Nov 2015 Link to this post

    Hello Patrik Johansson,

     

    Indeed as explained in the Create Custom Editor for a Bound Property article the editor template should be placed in the ~/Views/Shared/EditorTemplates folder in order to work properly. 

     

    The https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/custom-popup-editor/KendoUIMVC5/Views/Home project shows how to define a custom pop-up editor (when the grid edit mode is set to "popup"), not editor template for bound property. 

     

    Regards,
    Boyan Dimitrov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 05 Nov 2015 in reply to Boyan Dimitrov Link to this post

    Hi,

    Thanks for responding. I see, it's a bit confusing that they use the exact same folder name "EditorTemplates" and are both referred to as "Editor templates". Also, I find this solution of putting "property editors" under shared a bit lacking, especially if you build a big site with lots of customer property editors. That said, I can also see the benefit of it for reusing the same property editors in many different places. I think the best would be to allow both options and then let the user decide which EditorTemplates folder they prefer.

Back to Top
UI for ASP.NET MVC is VS 2017 Ready