How to link Kendo UI grid to my model collection in an editor template using MVC Razor

I have a grid 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 opens this Template editor to edit the line I selected (by pressing the Action button).

This editor template also contains a grid that will be attached 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 the Kendo UI and its grid to do what I want. I do not know how to associate the grid with the “collection” of my model.

+4
2

: Grid Popup

, , , . , !

+5

, . . :

- Kendo UI . , "ASP.NET MVC", "local_data.cshtml". , :

@model UserModel

@(Html.Kendo().Grid(Model.UserOrg)
    .Name("Grid")
    .Columns(columns =>
    {
        //set up your columns here
        columns.Bound(u => u.Name).Title("Name");
    })
    .Pageable()
    .Sortable()
    .Scrollable(scr=>scr.Height(430)) 
    .Filterable()    
    .DataSource(dataSource => dataSource        
        .Ajax()
        .PageSize(20)
        .ServerOperation(false)        
     )
)

SO, : Kendoui MVC EditorTemplateName PopUp

, ~\View\Shared\EditorTemplates, , column.EditorTemplateName("..").

+1

Source: https://habr.com/ru/post/1535576/


All Articles