本帖最后由 huafeihua116 于 2010-08-20 17:41:41 编辑

解决方案 »

  1.   

    通过row[index]去取得这一行的数据啊,然后保存
      

  2.   

     //判断在第一列Checkbox栏被选中的项目;
      if (row.Cells[0].Value != null && (bool)row.Cells[0].Value == true)
      {
      //写到这里就不会写了;   
      }
    你这里判断了如果是选中了就获取这一行的数据吗
    这一行的数据也是 row.Cells[1].Value ,row.Cells[2].Value ,row.Cells[3].Value 这样取得啊存放到比如TrcLaneInfoData中就用 
    TrcLaneInfoData data = new TrcLaneInfoData();
    data.xxx = row.Cells[1].Value 
      

  3.   

    foreach (DataGridViewRow dr in this.dataGridView1.Rows)
      {
      try
      {
      DataGridViewCheckBoxCell cbx = (DataGridViewCheckBoxCell)dr.Cells[0];
      if ((bool)cbx.FormattedValue)
      {
      str+= dr.Cells[1].Value;   
      }
      }
      catch (Exception ex)
      {
      MessageBox.Show(ex.Message);
      }
      }