private void ToolStripButton2_Click(object sender, EventArgs e) { my.Szap = Dgv1.Rows[Dgv1.CurrentCell.RowIndex].Cells[0].Value.ToString(); if (!my.isFormInMdi("frmCapSm", (int)Dgv1.Rows[Dgv1.CurrentCell.RowIndex].Cells[0].Value, my.MDIForm)) { frmCapSm fr = new frmCapSm(); fr.idsm = (int)Dgv1.Rows[Dgv1.CurrentCell.RowIndex].Cells["idsm"].Value; //fr.MdiParent = my.MDIForm; fr.Tag = fr.idsm; fr.ShowDialog(); //spisok(); } }
private void Dgv1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (Dgv1.Columns.Contains("IdSm")) { if (MessageBox.Show("Перейти в выбранную смету?", "Внимание!", MessageBoxButtons.YesNo) == DialogResult.Yes) { my.Szap = Dgv1.Rows[e.RowIndex].Cells[0].Value.ToString(); if (!my.isFormInMdi("frmCapSm", (int)Dgv1.Rows[e.RowIndex].Cells[0].Value, my.MDIForm)) { frmCapSm fr = new frmCapSm(); fr.idsm = (int)Dgv1.Rows[e.RowIndex].Cells["IdSm"].Value; fr.Tag = Dgv1.Rows[e.RowIndex].Cells["IdSm"].Value; fr.ShowDialog(); } } } }