请教一个关于DataGridView的一个用法:
比如在Form1中根据条件在DataGridView中显示查询结果,而这些结果又有详细的信息,这是需要点击DataGridView中的一行,在Form2中的DataGridView下显示详细信息。该怎么办????请给予指导,急用,谢谢!!!

解决方案 »

  1.   

    将form1中你选择的Datagridview中的某一行的参数传递给form2,然后再在form2中根据参数显示详细信息了!
      

  2.   

    获得datagridview1的选择行的第一列数据
    string value=datagridview1.Rows[datagridview1.CurrentRow.Index].Cells[0].Value.tostring();
      

  3.   

    谢谢楼上这位朋友,不过还有一个小问题,
    就是数据本应在Form2中的DataGridView下显示,可是总是提示出错:
    Form2.DataGridView1 is inaccessible due to its protection lever
    我已经把 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)改成了public
      

  4.   

    为什么我想在Form1中的DataGridView下显示的数据出现在了Form2中的DataGridView下