Kendo popup editor not working if in different folder

3 posts, 1 answers
  1. Jithu
    Jithu avatar
    2 posts
    Member since:
    Feb 2017

    Posted 20 Apr 2017 Link to this post


    I'm facing an issue with popup of a Kendo MVC grid.

    The Popup renders a custom "EditData.cshtml" view which is under the following folder structure--> Views/My/EditorTemplates/EditData.cshtml

    But if I move the EditorTemplates folder to another folder say "controls" (eg; Views/My/Controls/EditorTemplates/EditData.cshtml), the EditData.cshtml template view is not found by the pop-up and renders the default popup.

    The "EditData.cshtml" is also found if I move the Editortemplates folder to the Shared folder (Shared/EditorTemplates/EditData.cshtml).

    I want to place the EditorTemplates under the Controls folder in this structure --> Views/My/Controls/EditorTemplates/EditData.cshtml

    Any help would be highly appreciated:

    Below is the sample Grid :

            .Columns(columns =>
            columns.Bound(c => c.AccountNumber).Title("Account No").Width(30);
            columns.Bound(c => c.Identifier).Title("Identifier").Width(40);
            columns.Bound(c => c.Name).Title("Alias Name");
            columns.Bound(c => c.Status.DisplayName).Title("Status/Reason");
            columns.Template(@<text></text>).ClientTemplate(@"<a class='k-grid-edit' ><u>Edit</u></a>").Title("Action");

            .Editable(x => x.Mode(GridEditMode.PopUp).TemplateName("EditData").Window(y=>y.Animation(false)))  //rendering a view from the EditorTemplates folder          
            .Pageable(pageable => pageable
            .Events(e => e.Edit("CheckAccess"))        
            .DataSource(dataSource => dataSource
                .Read(read => read.Action("GetData", "My").Data("GetMemberNo")) 
                .Update(update => update.Action("UpdateData", "My"))
                .Model(model => model.Id(p => p.ID))


  2. Jithu
    Jithu avatar
    2 posts
    Member since:
    Feb 2017

    Posted 20 Apr 2017 in reply to Jithu Link to this post

    Seems like the Popup is going by the MVC folder naming conventions.. It's looking for Views/<ControllerName>/EditorTemplates/<ViewName>.cshtml

    Is there a way to change this behaviour of kendo grid pop-up?


  3. Answer
    Viktor Tachev
    Viktor Tachev avatar
    2495 posts

    Posted 21 Apr 2017 Link to this post

    Hi Jithu,

    When you specify custom editors they must be placed in the EditorTemplates folder. This is the convention used in MVC and it is also used with the Kendo components. 

    For more information on the matter please refer to the following stackoverflow thread:

    Viktor Tachev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top