title: How to verify if a DataGridViewCheckBoxCell is Checked
body: <p>I have bound a data table to a <code>DataGridView</code>, this data table has a column called "Status" which is of type <code>Boolean</code>.  I can set the value to <code>true</code> or <code>false</code> just fine via code.  </p>
  
  <p>However, I can't figure out how to check to see if the given row is already checked or not.  This is the code I am trying to use and compiling it shows the error "the specified cast is invalid".</p>
  
  <p>Any help would be appreciated.</p>
  
  <pre><code>if (rowIndex &gt;= 0)
  {
      var cbxCell = (DataGridViewCheckBoxCell)dgvScan.Rows[rowIndex].Cells["Status"];
  
      if ((bool)cbxCell.Value)
      {
          // Do stuff
      }
      else
      {
          // Do other stuff
      }
  }
  </code></pre>