我想在 dataGridView中的一列上输入完数据后直接敲回车,这时自动给其它列赋值,这个方法怎么写呢?

解决方案 »

  1.   

    http://zhidao.baidu.com/question/50871265.html这是光标离开时的方法...你要的方法参照一下就可以了
      

  2.   

    在 CellEndEdit里写...
            private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
            {
                this.Text = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
            }
            
      

  3.   

    DataGridView1_CellValueChanged 里面写也可以