Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 450
JudgeProphet Avatar asked Apr 08 '14 14:04

JudgeProphet


1 Answers

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!

like image 132
JudgeProphet Avatar answered Nov 11 '22 19:11

JudgeProphet