private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
int row = e.RowIndex;//获取当前选中的行下标.
string id = this.dataGridView1.Rows[row].Cells[0].Value.ToString();//根据行下边获取那一行得单元格集合,取单元格中的主键内容
string value = this.dataGridView1.SelectedCells[0].Value.ToString();//选中的单元格编辑完后的值
string headName = this.dataGridView1.Columns[e.ColumnIndex].HeaderText.ToString();//选中的单元格的列的表头内容
}