This is a migrated thread and some comments may be shown as answers.

"EditorTemplate" folder not working

3 Answers 325 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Patrik Johansson
Top achievements
Rank 1
Patrik Johansson asked on 03 Nov 2015, 09:12 PM

 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?

3 Answers, 1 is accepted

Sort by
0
Patrik Johansson
Top achievements
Rank 1
answered on 03 Nov 2015, 09:54 PM

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.

0
Boyan Dimitrov
Telerik team
answered on 05 Nov 2015, 02:08 PM

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
0
Patrik Johansson
Top achievements
Rank 1
answered on 05 Nov 2015, 02:17 PM

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.

Tags
Grid
Asked by
Patrik Johansson
Top achievements
Rank 1
Answers by
Patrik Johansson
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or