title: Bind JSON string to Gridview
body: <p>I am trying to take output from my JSON and add it to a Gridview.  I have created a DataTable to store the data and I am trying to bind that to my Gridview.  When I debug, I see each value being added to the DataTable.  By the end, there are 10 rows.  But nothing binds to the Gridview in the end.  Let me know if I need to add anything else to help.</p>
  
  <pre><code>var data = JsonConvert.DeserializeObject&lt;RootObject&gt;(result);
  
  DataTable dt = new DataTable();
  dt.Columns.Add("Site", typeof(string));
  dt.Columns.Add("Status", typeof(int));
  
  foreach (var item in data.records)
  {
      string site = item.name;
      string status = item.data;
      DataRow row = dt.NewRow();
      row[0] = site;
      row[1] = status;
      dt.Rows.Add(row);
  }
  
  GridView1.DataSource = dt;
  GridView1.DataBind();
  </code></pre>
  
  <p>JSON Output.  Just the records portion.</p>
  
  <pre><code>{
      "kind":"internal",
      "name":"SplashPageToggle_dg",
      "fullPath":"SplashPageToggle_dg",
      "generation":1255326,
      "selfLink":"https://link",
      "type":"stri ng",
      "records":[
          {
              "name":"enable_app1",
              "data":"0"
          },
          {
              "name":"enable_app2",
              "da ta":"0"
          },
          {
              "name":"enable_app3",
              "data":"0"
          },
          {
              "name":"enable_app4",
              "data":"0"
          },
          {
              "name":"enable_app5",
              "data":"0"
          },
          {
              "name":"enable_app6",
              "data":"1"
          },
          {
              "name":"enable_app7",
              "data":"0"
          },
          {
              "name":"enable_app8",
              "data":"0"
          },
          {
              "name":"enable_app9",
              "data":"0"
          },
          {
              "name":"enable_app10",
              "data":"0"
          }
      ]
  }
  </code></pre>
  
  <p>Gridview code</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Visible="true"&gt;
      &lt;Columns&gt;
          &lt;asp:BoundField HeaderText="Site" /&gt;
          &lt;asp:BoundField HeaderText="Status" /&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>