How to bind a Kendo UI Grid to a collection of my model in an editor template using MVC Razor

JudgeProphet picture JudgeProphet · Apr 8, 2014 · Viewed 13.7k times · Source

I Have a Grid that is based on a Model Similar to

public class UserModel
{
  ...
  public IList<UserOrgModel> UserOrg {get; set;}
  ...
}

This Grid is set to .Editable(e => e.Mode(GridEditMode.PopUp).TemplateName("...") and open this editorTemplate to edit the row I selected (by pressing Action Button).

This Editor Template contain also a Grid that would be bind to my collection.

I defined my grid this way

@(Html.Kendo().Grid(Model.UserOrg)
  .Name("blabla")
  .Columns(col => 
  {
    col.Bound(c => c.Id);
  })
)

When I do this my grid based on my collection is always empty. Any Idea how I can use Kendo UI and its grid to do what I want. I don't know how to bind my grid with the "collection" of my model.

Answer

JudgeProphet picture JudgeProphet · Apr 8, 2014

I found my Answer here: Grid Popup Editing Navigation Property Collection with nested Grid

I Downloaded the demo and All I wanted was there. This is exactly what I was looking for!