title: kendo ui grid for mvc read from viewbag
body: <p>I have a controller that returns a strongly typed view and the results of a dynamic sql procedure datatable via Viewbag. I'm trying to bind the grid to the Viewbag data in my view but I cant figure out how to do so.</p>
  
  <pre><code>@(Html.Kendo().Grid(ViewBag.Rev)
      .Name("RevGrid")
      .Pageable()
      .Sortable()
      .Filterable()
      .DataSource(dataSource =&gt; dataSource
          .Ajax()
          .PageSize(20)
          .ServerOperation(false)
  
       ))
  
  
  
  public ActionResult Index()
      {
          using (DataContext db = new DataContext())
          {
              var spring = db.SpringTrainings.ToList();
              ViewData["Rev"] = Revenue();
              return View(spring);
          }
      }
  </code></pre>
  
  <p>This is where the datatable comes from:</p>
  
  <pre><code>    public DataTable Revenue()
      {
          using (var conn = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
          {
              using (var commandproc = conn.CreateCommand())
              {
                  commandproc.CommandType = System.Data.CommandType.StoredProcedure;
                  commandproc.CommandText = "stTicketRevenue";
                  conn.Open();
                  {
                      var dataTable = new DataTable();
                      var dataReader = commandproc.ExecuteReader();
                      dataTable.Load(dataReader);
                      ViewBag.Proc = dataTable;
                      conn.Close();
                     return dataTable;
                  }
  
  
              }
          }
  
      }
  </code></pre>
  
  <p>I would really appreciate some help with this. I'm not even sure this is the right way to pass the datatable from the controller.</p>