title: Kendo UI Grid Basic implementation
body: <p>I’m trying to implement the basic functionality of the Grid, in that while compiling my project I’m getting an error saying “Object Expected”</p>
  
  <p>With the below lines of code:</p>
  
  <pre><code>         $(document).ready(function() {
                  $("#grid").kendoGrid({
                      dataSource: {
                          data: createRandomData(50),  //exception in this line of code
                          pageSize: 10
                      },
  </code></pre>
  
  <p>Can you help me in understanding what I need to write in place of the createRandomData?
  Is it the table name from where I’m taking the data to place it on the Grid or it is something else? (btw, I’m using as SQL server 2008 as the backend and running this code on Visual Studio 2010 MVC4) and i'm new to MVC and Kendo UI as well.</p>
  
  <p>What i'm trying to implement is binding the data from SQL server to the Grid using MVC 4.</p>
  
  <p>Thanks in advance! :)</p>
  
  <p>here's the code:</p>
  
  <pre><code>              &lt;script&gt;
              $(document).ready(function () {
                  $("#grid").kendoGrid({
                      dataSource: {
                          data: createRandomData(50),
                          pageSize: 10
                      },
                      groupable: true,
                      sortable: true,
                      pageable: {
                          refresh: true,
                          pageSizes: true
                      },
                      columns: [{
                          field: "FirstName",
                          width: 90,
                          title: "First Name"
                      }, {
                          field: "LastName",
                          width: 90,
                          title: "Last Name"
                      }, {
                          width: 100,
                          field: "City"
                      }, {
                          field: "Title"
                      }, {
                          field: "BirthDate",
                          title: "Birth Date",
                          template: '#= kendo.toString(BirthDate,"dd MMMM yyyy") #'
                      }, {
                          width: 50,
                          field: "Age"
                      }
                      ]
                  });
              });
          &lt;/script&gt;
  </code></pre>
  
  <p>here's the function defination:</p>
  
  <pre><code>    function createRandomData(count) {
         var data = [],
        now = new Date();
         for (var i = 0; i &lt; count; i++) {
          var firstName = firstNames[Math.floor(Math.random() * firstNames.length)],
          lastName = lastNames[Math.floor(Math.random() * lastNames.length)],
          city = cities[Math.floor(Math.random() * cities.length)],
          title = titles[Math.floor(Math.random() * titles.length)],
          birthDate = birthDates[Math.floor(Math.random() * birthDates.length)],
          age = now.getFullYear() - birthDate.getFullYear();
  
      data.push({
          Id: i + 1,
          FirstName: firstName,
          LastName: lastName,
          City: city,
          Title: title,
          BirthDate: birthDate,
          Age: age
      });
  }
  return data;
  </code></pre>
  
  <p>}</p>
  
  <p>should the controller return the value passed as count?</p>
  
  <pre><code>    public ActionResult createRandomData()
      {
         return View();
      }
  </code></pre>