Telerik MVC Grid won't load data into details table (subtable)
- by henriksen
I have a list of Plants and assosiated Projects. I want to output this in a table with all the Plants and use Telerik.Grid to expand a Plant, show a Telerik.Grid with associated Projects. I want the Projects to be dynamically loaded with Ajax.
The code for the grid:
@(Html.Telerik().Grid<PlantDto>()
.Name("Plants")
.Columns(columns =>
{
columns.Bound(plant => plant.Title);
})
.DetailView(details => details.ClientTemplate(
Html.Telerik().Grid<ProjectDto>()
.Name("Plant_<#= Id #>")
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("ProjectsForPlant", "User", new { plantId = "<#= Id #>" }))
.ToHtmlString()
))
.DataBinding(dataBinding => dataBinding.Ajax().Select("PlantsForUser", "User"))
)
The initial data is loaded into the grid just fine (the list of Plants) but when I expand a plant I just get an empty sub-table.
Looking in FireBug there are no calls to the server. The controller that should serve the list of projects is never called.
Anyone have an idea on what it could be?