title: KendoUI Grid Ajax Binding Parameters For Select
body: <p>I have a basic <code>KendoUI</code> Grid for my ASP.NET MVC app which uses ajax binding for the read.  I'd like to enhance this so that a Form above the grid is used to help select data that should be displayed in the grid.  This is a standard search form with basic fields like First Name, Last Name, Date of Birth, Customer Source, etc. with a search button.  When the search button is pressed, I want to force the grid to go get the data that meets the criteria from the controller by passing in the Search Model with the fields I referenced above.</p>
  <p>The search form is contained within the _CustomerSearch partial view.</p>
  <p>I've implemented this sort of thing before with the Telerik MVC extensions by tapping into the OnDataBinding client event and updating the parameter values there and then manually making the Ajax call to get the data.  It doesn't appear KendoUI will operate this same way.</p>
  <h2>View</h2>
  <pre><code>@Html.Partial(&quot;_CustomerSearch&quot;, Model)
  &lt;hr&gt;
  @(Html.Kendo().Grid&lt;ViewModels.CustomerModel&gt;()    
      .Name(&quot;Grid&quot;)
      .Columns(columns =&gt;
      {
          columns.Bound(p =&gt; p.Id).Hidden(true);
          columns.Bound(p =&gt; p.FirstName);
          columns.Bound(p =&gt; p.LastName);
          columns.Bound(p =&gt; p.DateOfBirth).Format(&quot;{0:MM/dd/yyyy}&quot;);
          columns.Bound(p =&gt; p.IsActive);
      })
      .Scrollable()
      .Filterable()
      .Sortable()
      .DataSource(dataSource =&gt; dataSource
          .Ajax()
          .Read(read =&gt; read.Action(&quot;_Search&quot;, &quot;Customer&quot;))
      )
  )
  </code></pre>
  <h2>Controller</h2>
  <pre><code>public ActionResult _Search([DataSourceRequest]DataSourceRequest request)
  {
      return Json(DataService.GetCustomers2().ToDataSourceResult(request));
  }
  </code></pre>
  <p>I envision the controller looking something like this, but can't find any examples of anything being implemented this way, which is what I need help with.</p>
  <pre><code>public ActionResult _Search([DataSourceRequest]DataSourceRequest request, CustomerSearchModel customerSearchModel)
  {
      return Json(DataService.GetCustomers2(customerSearchModel)
                 .ToDataSourceResult(request));
  }
  </code></pre>