I want to use custom template for my KendoGird and I have nested details inside the grid
this is my code:

@(Html.Kendo()
      .Grid(Model)
      .Name("grid")
      .Columns(columns =>
          {
              columns.Template(@<text></text>)
                     .ClientTemplate(
                          "<div>" +                                      
                          "<div style=\"float:left\">#= SomeFeild1#</div>" +                                      
                          "<div style=\"clear:both;\">" +
                          "#= SomeFeild2#" +
                          "</div>" +
                          "<div class=\"attache\" style=\"clear:both\">" +
                          "#=CreateGrid(Id)#" +
                          "</div>" +                                     
                          "</div>");
          })
   .Sortable()
   .Pageable()
   .DataSource(dataSource => dataSource
                   .Ajax().PageSize(20)
                   .ServerOperation(false)))

and this JavaScript function return the nested details in html form:

function CreateGrid(id) {
    return "Some more html";
}

all is working fine but it's mess, it will be difficult if I wanted to make the slightest change
how can I do it in a cleaner way?

Related posts

Recent Viewed