Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6730291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:23:29+00:00 2026-05-26T10:23:29+00:00

I have a grid using AJAX DATABINDING. When I issue a POPUP EDITING command

  • 0

I have a grid using AJAX DATABINDING.
When I issue a POPUP EDITING command with TEMPLATENAME SPECIFIED my NESTED EDITOR TEMPLATES are not populating.

My Models

namespace eGate.BackOffice.WebClient.Model
{
    public class TemplateTesterModel
    {
        public int TemplateModelId { get; set; }
        public string TemplateModelName { get; set; }
        public List<UserRole> UserRoles { get; set; }
    }
}

{
    public class TemplateTesterModels : List<TemplateTesterModel>
    {
    }
}

My View

@model eGate.BackOffice.WebClient.Model.TemplateTesterModels                  
@Html.EditorFor(m=>m)
 
@( Html.Telerik().Grid<eGate.BackOffice.WebClient.Model.TemplateTesterModel>()
        .Name("Grid")
        .DataKeys(keys => { keys.Add(m=>m.TemplateModelId); })
        .Columns(columns =>
        {
            columns.Bound(o => o.TemplateModelId);
            columns.Bound(o => o.TemplateModelName).Width(200);
            columns.Bound(o => o.UserRoles).ClientTemplate(
                                                 "<# for (var i = 0; i < UserRoles.length; i++) {" +
                                                 "#> <#= UserRoles[i].RoleName #>  <#" +
                                                 "} #>")
                                                 ;
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.Text);
            }).Width(180).Title("Commands");
        })
        .DataBinding(dataBinding => dataBinding.Ajax()
                        .Select("_SelectAjaxEditing", "TemplateTester")
                        .Insert("_InsertAjaxEditing", "Grid")
                        .Update("_SaveAjaxEditing", "TemplateTester")
                        .Delete("_DeleteAjaxEditing", "TemplateTester")
                     )
 
        .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("TemplateTesterModel"))
)

My Controller

namespace eGate.BackOffice.WebClient.Controllers
{
    public class TemplateTesterController : Controller
    {
        public ActionResult Index()
        {
            return View(GetTemplateTesters());
            //return View(new GridModel(GetTemplateTesters()));
        }
        private TemplateTesterModels GetTemplateTesters() {
 
            TemplateTesterModels returnme = new TemplateTesterModels();
            returnme.Add(new TemplateTesterModel());
            returnme[0].TemplateModelId = 0;
            returnme[0].TemplateModelName = "Template Tester 0";
            returnme[0].UserRoles = new List<UserRole>();
            returnme[0].UserRoles.Add(new UserRole() { RoleName = "Role1", IsChecked = true, Description = "Role for 1" });
            returnme[0].UserRoles.Add(new UserRole() { RoleName = "Role2", IsChecked = false, Description = "Role for 2" });
            returnme[0].UserRoles.Add(new UserRole() { RoleName = "Role3", IsChecked = false, Description = "Role for 3" });
            return returnme;
        }
        [GridAction]
        public ActionResult _SelectAjaxEditing()
        {
            return View(new GridModel(GetTemplateTesters()));
        }
        [AcceptVerbs(HttpVerbs.Post)]
        [GridAction]
        public ActionResult _SaveAjaxEditing(int id)
        {
            return View(new GridModel(GetTemplateTesters()));
        }
        [GridAction]
        public ActionResult _InsertAjaxEditing(){
            return View(new GridModel(GetTemplateTesters()));
        }
        [AcceptVerbs(HttpVerbs.Post)]
        [GridAction]
        public ActionResult _DeleteAjaxEditing(int id)
        {
            return View(new GridModel(GetTemplateTesters()));
        }
 
 
    }
}

My EditorTemplates
Shared/EditorTemplates/TemplateTesterModel.cshtml

@model eGate.BackOffice.WebClient.Model.TemplateTesterModel
<div>TemplateTesterModel Editor</div>
<div>@Html.EditorFor(m=>m.TemplateModelId)</div>
<div>@Html.EditorFor(m=>m.TemplateModelName)</div>
<div>Roles</div>
<div>@Html.EditorFor(m=>m.UserRoles)</div>

Shared/EditorTemplates/UserRole.cshtml

@model eGate.BackOffice.WebClient.Model.UserRole
   
<div>
I can has user role?
@Html.CheckBoxFor(m=>m.IsChecked)
</div>

This renders out as such:

enter image description here

As you can see the @Html.EditFor statements that precede the grid filter down through to the userrole EditorTemplate as expected. Additionally we can see that role data is in the grid because it is showing up in the role column.

But click the edit window and this is the result:

enter image description here

As you can see the UserRoles template is not populating with the roles on the UserRoles property of the TemplateTesterModel we’re editing.

Am I missing something? Why is the .UserRoles property not populating in the telerik grid pop-up window?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:23:30+00:00Added an answer on May 26, 2026 at 10:23 am

    This could be a “by design” decision of ASP.NET MVC. It does not automatically render display and editor templates for nested complex objects. I even have a blog post discussing this.

    Long story short you need to create a custom editor template for the parent model.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is not an AJAX request/response callback question... I am building a grid using
I have an MVC3 application doing AJAX edit of a grid line using JQUERY
I am using vb.net code. I have grid view, please see the code below:
We're using Infragistics grid (most probably, we'll have 8.2 version at the end) and
We have a requirement to increase the functionality of a grid we are using
I'm using the Blueprint CSS grid for my HTML page. I have a table
Hopefully this is a quick one! I have an editable grid using 'clientSide' (local)
I have a search that returns an AJAX(MVC AJAX Form) grid, and, in the
I have an MVC masterpage set up which loads a dynamic menu using AJAX
I am using jqgrid 3.8. I have a grid which is having some editable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.