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

[Solved] TemplateName do not work in PopUp edit mode

4 Answers 188 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tomas
Top achievements
Rank 1
Tomas asked on 03 Apr 2012, 03:50 PM
I have set up TemplateName like this

Editable(editing => editing.Mode(GridEditMode.PopUp).TemplateName("AdminUserForm"))

to have my own editor form. I also create partial view 

AdminUserForm.cshtml
@model PC.Models.UserViewModel
@{
    Layout = null;
}
@Html.EditorFor(p=>p.FirstName)
@Html.EditorFor(p=>p.LastName)

My action looks like

        public ActionResult AdminUserForm(UserViewModel model)
        {
            return View(model);
        }

Unfortunately Grid still loads default edit form. Why my partial view is not loaded? Actual Grid view file and AdminUserForm.cshtml are in the same folder under Views\Admin. The AdminUserForm action is never called.


4 Answers, 1 is accepted

Sort by
0
Accepted
Dadv
Top achievements
Rank 1
answered on 03 Apr 2012, 04:01 PM
Try to move your template to ~/Views/Shared/EditorTemplates
0
Tomas
Top achievements
Rank 1
answered on 03 Apr 2012, 04:03 PM
Do I need to create Action while loading partial template? The problem is that Action which loads partial view is never called.
0
Tomas
Top achievements
Rank 1
answered on 03 Apr 2012, 04:05 PM
It seems that your suggestion solved the problem! No need to create Action for loading template, the Telerik Grid loads partial view directly. 
0
Dadv
Top achievements
Rank 1
answered on 03 Apr 2012, 04:14 PM
EditorTemplates is a special MVC folder (like DisplayTemplates)
Tags
Grid
Asked by
Tomas
Top achievements
Rank 1
Answers by
Dadv
Top achievements
Rank 1
Tomas
Top achievements
Rank 1
Share this question
or