title: Kendo Grid Ajax Data binding
body: <p>I am trying to implement the Grid in ASP.NET MVC 5 app. I have use table in razor to test code and is pulling data properly, however i am trying to do server binding using provided Kendo helper classes but i am struggling to pull data to view. I am using Repository pattern and UnitOfWork.... the code is below ...</p>
  
  <p>my 2nd question is, which is the best way to use Multiple Models in Single View???? I have also ViewModel but i havn't use in following code.. can i use @(Html.Kendo().Grid() and @(Html.Kendo().Grid() in same view... many thanks in advanced...</p>
  
  <h2>Repository Class:</h2>
  
  <pre><code> public IEnumerable&lt;FeeScheme&gt; GetAllFeeScheme()
      {
          return getAllFeeSchemeFromRepository();
      }
  </code></pre>
  
  <h2>UnitOfWork class</h2>
  
  <pre><code>  private IEnumerable&lt;FeeScheme&gt; getAllFeeSchemeFromRepository()
      {
          IEnumerable&lt;FeeScheme&gt; query = new List&lt;FeeScheme&gt;();
  
          query = (from b in _FeeScheme_Repository.GetAll()
                   select b).ToList();
  
          return query;
      }
  
      public IEnumerable&lt;FeeScheme&gt; GetAllFeeScheme()
      {
          return getAllFeeSchemeFromRepository();
      }
  </code></pre>
  
  <h2>Controller class</h2>
  
  <pre><code>  public JsonResult GetAllFeeScheme([DataSourceRequest]DataSourceRequest request)
      {
  
          return Json(FeeScheme_UOF.GetAllFeeScheme().ToDataSourceResult(request));
  
      }
  </code></pre>
  
  <h2>      View (Kendo )</h2>
  
  <pre><code>  @(Html.Kendo().Grid&lt;DatabaseLayer.TableMappings.FeeScheme&gt;()
          .Name("Grid")
          .Columns(columns =&gt;
                   {
                       columns.Bound(c =&gt; c.FeeSchemeID);
                       columns.Bound(c=&gt;c.FeeSchemeDescription);
                       columns.Bound(c =&gt; c.Fee);
                   })
                           .HtmlAttributes(new { style = "height: 380px;" })
              .Scrollable()
              .Groupable()
              .Sortable()
              .Pageable(pageable =&gt; pageable
                  .Refresh(true)
                  .PageSizes(true)
                  .ButtonCount(5))
              .DataSource(dataSource =&gt; dataSource
                  .Ajax()
                  .Read(read =&gt; read.Action("GetAllFeeScheme", "Qualification"))
                  .Model(model =&gt; model.Id(c=&gt;c.FeeSchemeID))
              )
          )
  </code></pre>