添加鼠标事件:
textBox.txt=选中的内容;

解决方案 »

  1.   

    private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
            {            textBox1.Text =dataGridView1.Rows[dataGridView1.CurrentRow.Index ].Cells["id"].Value.ToString()  ;
     
            }
      

  2.   

    private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
      {  textBox1.Text =dataGridView1.Rows[dataGridView1.CurrentRow.Index ].Cells["id"].Value.ToString() ;
      
      }