private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex==2)
{
textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
//textBox1.Text = (string)(this.dataGridView1.Rows[e.RowIndex].Cells[2] as DataGridViewComboBoxCell).Value.ToString();
}
if (e.ColumnIndex==1)
{
textBox1.Text = "第二行的";
}
}
datagridview编辑后需要点其他位置,才能在textbox显示出来