title: Marking Checkboxes in Data grid View on the basis of Datatable
body: <p>I have a Data grid View <code>dataGridView1</code> which is bind with a data table <code>dt1</code>. </p>
  
  <p>Data table <code>dt1</code> has following data:</p>
  
  <pre><code>name | status
  -----+-------
  abc  |   0
  abd  |   1
  abc  |   0
  abc  |   1
  abc  |   1
  </code></pre>
  
  <p>I am putting a check box in Data gridview and I want the default value of check box as checked where the status = 1. </p>
  
  <pre><code>DataGridViewCheckBoxColumn checkColumn = new DataGridViewCheckBoxColumn();
  checkColumn.Name = "X";
  checkColumn.HeaderText = "X";
  
  dataGridView1.Columns.Add(checkColumn);
  
  for (int x = 0; x &lt; countSubCategory; x++)
  {
      if (dt1.Rows[x].ItemArray[1].ToString() == "1")
      {
            // here I want to check the checkbox but I don't know what to write here
            checkColumn.Checked= true;
      }
  
      else { 
          checkColumn.Value = false; 
      }
  } 
  </code></pre>