日期:2014-05-17 浏览次数:21246 次
public delegate void AsyncDelegate(); public void ShowChild()//弹出子窗体 { CFrmChild FrmChild = new CFrmChild(dgv.CurrentRow); FrmChild.ShowDialog(); } private void dgv_CellDoubleClick(object sender, DataGridViewCellEventArgs e)//双击弹出子窗体 { AsyncDelegate dlgt = new AsyncDelegate(this.ShowChild); IAsyncResult ar = dlgt.BeginInvoke(null, null); dlgt.EndInvoke(ar); }
private DataGridViewRow dgvrMain; public CFrmChild(DataGridViewRow dgvr) { InitializeComponent(); this.dgvrMain = dgvr; //txtNum.Text = dgvr.Cells["ZHLDAH"].Value.ToString(); txtNum.DataBindings.Add("Text", dgvr.DataBoundItem, "ZHLDAH");//质量档案编号 txtNote.DataBindings.Add("Text", dgvr.DataBoundItem, "ZHUYSX");//注意事项 } private void btnOK_Click(object sender, EventArgs e)//确定 { dgvrMain.Cells["ZHLDAH"].Value = txtNum.Text; dgvrMain.Cells["ZHUYSX"].Value = txtNote.Text; this.Close(); }