title: Looping through datagridview and reading the CheckBoxColumn value
body: <p>I have a datagridview with one DataGridViewCheckBoxColumn and some other TextBox Columns. I want to loop through each cell and see if the checkbox is checked then do something. I am using the following looping method. Is there a better way to do??</p>
  
  <p>I have used or condition because in some computers it brings <code>.Value</code> as Checked and in some it bring <code>.Value</code> as true.</p>
  
  <pre><code>     foreach (DataGridViewRow row in dataGridView.Rows)
                  {
                      if ((bool)(row.Cells["Checkbox"]).Value || (CheckState)row.Cells["Checkbox"].Value == CheckState.Checked)
                      {   
                          // Do something
                      }
  
                  }
  </code></pre>
  
  <p>Thanks in advance.</p>