请教一个关于DataGridView的一个用法:
比如在Form1中根据条件在DataGridView中显示查询结果,而这些结果又有详细的信息,这是需要点击DataGridView中的一行,在Form2中的DataGridView下显示详细信息。该怎么办????请给予指导,急用,谢谢!!!
比如在Form1中根据条件在DataGridView中显示查询结果,而这些结果又有详细的信息,这是需要点击DataGridView中的一行,在Form2中的DataGridView下显示详细信息。该怎么办????请给予指导,急用,谢谢!!!
string value=datagridview1.Rows[datagridview1.CurrentRow.Index].Cells[0].Value.tostring();
就是数据本应在Form2中的DataGridView下显示,可是总是提示出错:
Form2.DataGridView1 is inaccessible due to its protection lever
我已经把 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)改成了public