就是说没有找到checkbox ,用 CheckBox box=(CheckBox)dgvr.Cells[列索引].FindControl("check")as CheckBox, 得到CheckBox 对象后,就好操作了

解决方案 »

  1.   

    foreach (DataGridViewRow dgvr in dgvAdmin.Rows) 

          if (dgvr.Cells["check"].FormattedValue.ToString() == "1") 
          { 
          } 

      

  2.   

    foreach (DataGridViewRow dgvr in dgvAdmin.Rows) 

          bool check = Convert.ToBoolean(dgvr.Cells["check"].FormattedValue);
          if ( check ) 
          { 
          } 
          else
          {
          }

      

  3.   

    FindControl方法,注意类型的转换