title: How to set list as kendo grid datasource in javascript?
body: <p>I have a modelview list and want to set this list as kendo grid datasource in a kendo window .</p>
  
  <p><strong>Ajax</strong></p>
  
  <pre><code>    $.ajax({
          url: '@Url.Action("KatildigiKurslar", "Tanim")',
          type: 'POST',
          dataType: "json",
          data: { kursiyerId: kursiyerId},
          success: function (result) {
              var kurslar =result.kurslar;
              //----------I've tried like this but not working ----------------//
              var dataSource = new kendo.data.DataSource({
                  data:kurslar
              });
             $('#GridKatildigiKurslar').data("kendoGrid").setDataSource(kurslar);
  
              $("#KatildigiKurslar").data("kendoWindow").open();
          },
          async: false
      });
  </code></pre>
  
  <p><strong>Kendo Window / Grid</strong></p>
  
  <pre><code>@(Html.Kendo().Window()
      .Name("KatildigiKurslar")
      .Title("Katıldığı Kurslar")
      .Draggable()
      .Content(
      @&lt;text&gt;
         @(Html.Kendo().Grid&lt;OnlineKursKayit.ViewModels.KursiyerSinifViewModel&gt;()
      .Name("GridKatildigiKurslar")
      .Columns(columns =&gt;
      {
          columns.Bound(p =&gt; p.KursEgitmenAdi).Width(100);
          columns.Bound(p =&gt; p.KursDonemi).Width(200);
          columns.Bound(p =&gt; p.BaslangicTarihi).Width(200);
      })
      .Pageable()
      .AutoBind(false)
      .DataSource(dataSource =&gt; dataSource
          .Ajax()
          .PageSize(7)
         )
      )
      &lt;/text&gt;)
      .Visible(false)
      .Resizable()
      .Actions(actions =&gt; actions.Minimize().Maximize().Close())  
  )     
  </code></pre>
  
  <p><strong>Model View</strong></p>
  
  <pre><code>public class KursiyerSinifViewModel
  {
      public string KursEgitmenAdi { get; set; }
  
      public string KursDonemi{ get; set; }
  
      public string BaslangicTarihi{ get; set; }
  }
  </code></pre>