private void btnAdd_Click(object sender, EventArgs e) { var tmp = new Template(); var frm = new EditTemplate(tmp); if (frm.ShowDialog() == DialogResult.OK) { } }
private void dataGridView1_DoubleClick(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count == 1) { var obj = dataGridView1.SelectedRows[0].DataBoundItem as Template; var frm = new EditTemplate(obj); if (frm.ShowDialog() == DialogResult.OK) { } } }