Telerik MVC Grid won't load data into details table (subtable)

Posted by henriksen on Stack Overflow See other posts from Stack Overflow or by henriksen
Published on 2011-01-12T14:08:03Z Indexed on 2011/01/12 16:54 UTC
Read the original article Hit count: 226

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about AJAX