title: How to get the row index of multiple checked in checkbox column of datagridview C#
body: <p>I am trying to remove a all marked/checked rows in an unbound datagridview. The checkbox column was added programatically. I know that I have to use </p>
  
  <pre><code>RequestedEmpGrid.Rows.Remove(RequestedEmpGrid.Rows[ForRequestRow.Index]);
  </code></pre>
  
  <p>to remove the row from the grid. However, I am having trouble getting the row index of the multiple checked rows in the datagridview. My looping is not working. Help?</p>
  
  <pre><code>                    //REMOVE ALL CHECKED
                      foreach (DataGridViewRow ForRequestRow in RequestedEmpGrid.Rows)
                      {
                          if (Convert.ToBoolean(ForRequestRow.Cells[MarkColumn.Name].Value) == true)
                          {
                              RequestedEmpGrid.Rows[ForRequestRow.Index].Selected = true;
                              RequestedEmpGrid.Rows.Remove(RequestedEmpGrid.Rows[ForRequestRow.Index]);
                          }
                      }
  </code></pre>