解决方案 »

  1.   

    dataGridView.SelectedRows是干嘛用的
      

  2.   

    遍历吧。你在btn按钮里面只能遍历了。
    如果在dataGridView1_CellContentClick事件里,可以
      string c = dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString();
      

  3.   

       object c= dataGridView1.SelectedRows[1].Cells[2].Value;
      

  4.   

    楼上正解,全选就遍历,单选
     如果在GridView1_SelectedIndexChanging事件里,可以
      string c =  GridView1.DataKeys[e.NewSelectedIndex].Value.ToString();
    获取绑定GridView1的表主键,之后就不用写了吧
      

  5.   


    this.gridView1.GetFocusedRow() as  entity;