private void btnCopy_Click(object sender, EventArgs e) { var key = this.dataGridViewExt1.CurrentRow.Cells["ID"].Value; if (key == null) { MessageBox.Show("请先选择一行数据"); } else { this.SelectedID = Int32.Parse(key.ToString()); this.IsCopy = true; ProjectPlanForm tempForm = FormSingle.GetForm(typeof(ProjectPlanForm)) as ProjectPlanForm; tempForm.ShowNormal(this.ParentForm); _loacateIndex = true; } }
private void dataGridViewExt1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex == 3) { return; } var key = dataGridViewExt1.Rows[e.RowIndex].Cells["ID"].Value; if (key == null) { MessageBox.Show("请先查询"); } else { this.SelectedID = Int32.Parse(key.ToString()); this.IsCopy = false; ProjectPlanForm tempForm = FormSingle.GetForm(typeof(ProjectPlanForm)) as ProjectPlanForm; tempForm.ShowNormal(this.ParentForm); _loacateIndex = true; } }