熟悉DataGridView 使用的请进
在DataGridView 中双击一行, 跳出一个winform 进行该行的编辑的 操作代码?
form1
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
Form2 frm = new Form2();
frm.StrName = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
frm.Show();
}
form2中
private string strName = string.Empty;
public string StrName
{
get
{
return strName;
}
set
{
strName = value;
this.xl_name.Text = strName;
}
}
这样就就ok了!!!!谢谢你们的光临....