This example shows how to implement related grids. The first grid is bound to the Customers table from the Northwind database. The second shows the orders for the selected customer from the first grid.

This example is implemented by using a Command column with a singleSelect command in it. When using a Command collumn you need to specify the DataKeys for the grid.

<%= Html.Telerik().Grid((IEnumerable<Customer>)ViewData["Customers"])
        .Name("Customers")
        .DataKeys(dataKeys => dataKeys.Add(c => c.CustomerID))
        .Columns(columns =>
        {
            columns.Command(commands => commands.Select()).Title("Select");
            columns.Bound(c => c.CustomerID).Width(130);
            columns.Bound(c => c.CompanyName).Width(250);
            columns.Bound(c => c.ContactName);
            columns.Bound(c => c.Country).Width(200);
        })
        .Pageable()
%>

<%= Html.Telerik().Grid((IEnumerable<Order>)ViewData["Orders"])
        .Name("Orders")
        .Columns(columns=>
        {
            columns.Bound(c => c.OrderID).Width(100);
            columns.Bound(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}");
            columns.Bound(c => c.ShipAddress);
            columns.Bound(c => c.ShipCity).Width(200);
        })
        .Pageable()
        .Sortable()
%>
</pre>