Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately I cannot comment on posts yet to clarify some facts about your question. I'll make some assumptions in my answer so that we can work out the exact nature of the problem. You have two model classes one for each grid ClientsModel and CarModel. You are filtering the CarModel (second)grid with fields from the ClientsModel (first)grid.</p> <p>You are not restricted to just one(&lt;= ClientID =>) parameter in your select binding. You can use other fields from the ClientsModel class the same way as ClientID. </p> <p>Sample Code:</p> <pre><code>dataBinding.Ajax().Select("_CarLineIndex", "Client", new { id = "&lt;#= ClientID #&gt;", city = "&lt;#= City #&gt;" }) </code></pre> <p>Here is a working example with mock data that illustrates the method mentioned above:</p> <p>Client Class</p> <pre><code>public class Client { public int ClientId { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string City { get; set; } } </code></pre> <p>Car Class</p> <pre><code>public class Car { public string Make { get; set; } public string Model { get; set; } public int Year { get; set; } public string Color { get; set; } } </code></pre> <p>HomeController</p> <pre><code>[GridAction] public ActionResult _Index() { Client c1 = new Client() { ClientId = 1, City = "Boston", FirstName = "Ted", LastName = "Boder" }; Client c2 = new Client() { ClientId = 2, City = "New York", FirstName = "Chris", LastName = "Tobb" }; Client[] clients = {c1, c2}; return View(new GridModel(clients)); } [GridAction] public ActionResult _Cars(int ClientId, string City) { Car c1 = new Car() { Color = "Yellow", Make = "Ford", Model = "Mustang", Year = 2012 }; Car c2 = new Car() { Color = "Black", Make = "Toyota", Model = "Camry", Year = 2010 }; Car[] cars = { c1, c2 }; return View(new GridModel(cars)); } </code></pre> <p>View</p> <pre><code>@(Html.Telerik().Grid&lt;Client&gt;() .Name("Clients") .Columns(columns =&gt; { columns.Bound(o =&gt; o.FirstName); columns.Bound(o =&gt; o.LastName); columns.Bound(o =&gt; o.City); }) .DetailView(clientDetailView =&gt; clientDetailView.ClientTemplate( Html.Telerik().Grid&lt;Car&gt;() .Name("ClientDetails_&lt;#= ClientId #&gt;") .Columns(columns =&gt; { columns.Bound(c =&gt; c.Make); columns.Bound(c =&gt; c.Model); columns.Bound(c =&gt; c.Year); columns.Bound(c =&gt; c.Color); }) .DataBinding(db2 =&gt; db2.Ajax().Select("_Cars", "Home", new { ClientID = "&lt;#= ClientId #&gt;", City = "&lt;#= City #&gt;" })) .Pageable() .Sortable() .ToHtmlString() )) .DataBinding(db1 =&gt; db1.Ajax().Select("_Index", "Home")) .Pageable() .Sortable() .Filterable() ) </code></pre> <p>As you can see from the example I'm also passing a City parameter as well as a ClientId when binding the grid.</p> <p>Let me know if I missed something.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload