Outer Grid:
Inner Grid:
@(Html.Kendo().Grid(Model) .Name("assetTypeGrid") .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) .ClientTemplate(createLink).Width(100); }) .Sortable() .Pageable(pageable => pageable .ButtonCount(5)) .Filterable(ftb => ftb.Mode(GridFilterMode.Row)) .ClientDetailTemplateId("template") .DataSource(dataSource => dataSource .Ajax() .PageSize(20) .ServerOperation(false)) )<script id="template" type="text/kendo-tmpl"> @(Html.Kendo().Grid<CIMSDashboard.ViewModels.AssetTemplateViewModel>() .Name("grid_#=Name#") .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 .Ajax() .PageSize(10) .Read(read => read.Action("GetAssetTemplates", "AccessRetriever", new { templateName = "Pipe" })) ) .Pageable() .Sortable() .ToClientTemplate() ) </script>Script:
<script type="text/javascript"> $(document).ready(function () { function dataBound() { this.expandRow(this.tbody.find("tr.k-master-row").first()); } }); </script>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) { result.Add(q); } } } 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.
