Grid inside Grid clienttemplate not binding

2 posts, 0 answers
  1. Kahl
    Kahl avatar
    15 posts
    Member since:
    Nov 2016

    Posted 18 Nov 2016 Link to this post

    I have a grid that I want to display inside a ClientTemplate, but the datasource is not binding

    What am I missing to get the bind to occur.

    Thanks

     

     

    @(Html.Kendo().Grid<WebSite.Library.Models.SiteCriteria>()
    .Name("siteCriteriaCriteria")
    .Columns(columns =>
    {
    columns.Bound(p => p.siteId).Title("siteId").Width(50).Hidden();
    //columns.Bound(p => p.premiseAreaId).Title("premiseId").Width(50).Hidden();
    columns.Bound(p => p.areaId).Title("AreaId").Width(50).Hidden();
    columns.Bound(p => p.name).Title("Hazard Area").Width(150);
    columns.Template(p => "").Title("criteria").ClientTemplate(
    Html.Kendo().Grid<WebSite.Library.Models.SiteCriteria>()
    .Name("areaCriteria#=areaId#")
    .Columns(c =>
    {
    c.Bound(e1 => e1.name).Title("Training").Width(100);
    })
    .AutoBind(true)
    .DataSource(source1 => source1
    .Custom()
    .Transport(transport => transport
    .Read(read =>
    {
    read.Url("/Api/SiteInfo/_getTrainingAreas/_si=12117")
    .DataType("json");
    })

    ))

    .ToClientTemplate()
    .ToHtmlString()
    );
    })
    //.Events(events => events.Remove("onRemove"))
    .NoRecords("No criteria exists.")
    .DataSource(source => source
    .Custom()
    .Transport(transport => transport
    .Read(read =>
    {
    read.Url("/Api/SiteInfo/_getPremiseArea/_si=" + Model.SiteId )
    .DataType("json");
    })
    ))
    )

  2. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 22 Nov 2016 Link to this post

    Hello Kahl,

    Please make sure you have evaluated the scripts manually on Grid's dataBound event as described in the following help article.

    Regards,
    Kostadin
    Telerik by Progress
    Telerik UI for ASP.NET MVC is ready for Visual Studio 2017 RC! Learn more.
Back to Top