Grid / Hierarchy, the function of inner grid define in read method is not being called at all

2 posts, 0 answers
  1. Bryan
    Bryan avatar
    8 posts
    Member since:
    Jul 2014

    Posted 28 Dec 2016 Link to this post

    Outer Grid:
                    .Columns(columns =>
                        columns.Bound(a => a.Type).ClientTemplate(@"<img src='/Content/Images/Pins/#:data.Type#' style='height: 32px; weight: 32px;' />").Width(100);
                        columns.Bound(a => a.Description).Title("Name").Width(200);
                        columns.Bound(a => a.Tabs).Title("Available Tab(s)").Width(200);
                        columns.Bound(a => a.AssetTypeId).Title("").Filterable(false).Sortable(false)
                    .Pageable(pageable => pageable
                    .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
                    .DataSource(dataSource => dataSource
    Inner Grid:
    <script id="template" type="text/kendo-tmpl">
           .Columns(columns =>
               columns.Bound(o => o.Types).Width(110);
               columns.Bound(o => o.Name).Width(110);
               columns.Bound(o => o.Description).Width(110);
           .DataSource(dataSource => dataSource
               .Read(read => read.Action("GetAssetTemplates", "AccessRetriever", new { templateName = "Pipe" }))
    <script type="text/javascript">
            $(document).ready(function () {
                function dataBound() {
    Read Function:
    public static List<AssetTemplateViewModel> GetAssetTemplates(string templateName)
                using (MiniProfiler.Current.Step("Getting Asset template Details"))
                    var result = new List<AssetTemplateViewModel>();
                    using (var context = ProfiledContext())
                        var query = from ta in context.tblTemplate_Assets
                                join at in context.tblAssetTypes on ta.AssetType equals at.Name
                                join atl in context.tblLink_AssetTypeToTemplate_Assets on ta.keyTempAssetID equals atl.fk_Template_AssetID
                                where atl.fk_AssetType == templateName
                                    select new AssetTemplateViewModel()
                                        Types = at.Logo,
                                        Name = ta.Name,
                                        Description = ta.Description
                        if (query.Any())
                            foreach (var q in query)
                    return result;


    The above read function is not being called.. am I missing something?? the layout of inner grid is coming perfectly, its all about data is not being displayed.. it is not reaching my break point in AccessRetriver at all...   I've attached pictures of my output.. pls help me. Thank you in advance.

  2. Viktor Tachev
    Viktor Tachev avatar
    2501 posts

    Posted 30 Dec 2016 Link to this post

    Hi Bryan,

    Make sure that the Read method of the nested Grid is using signature similar to the following. The GetData() method implements the logic for returning the records from the data source.

    public ActionResult GetAssetTemplates(string templateName, [DataSourceRequest] DataSourceRequest request)
        return Json(GetData()
            .Where(item => item.TemplateName == templateName)

    In case you would like a live example on how you can implement Grid with hierarchical structure please refer to the example below.

    Viktor Tachev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top