private void cmdAdd_Click(object sender, EventArgs e) { Master.frmRightsUpdate ifrmChild = new Master.frmRightsUpdate(this); ifrmChild.MdiParent = Program.MainForm; Program.MainForm.RegisterChild(ifrmChild); ifrmChild.Show(); }
private void cmdEdit_Click(object sender, EventArgs e) { if (dataGridView1.SelectedCells.Count > 0) { string rightID = dataGridView1.SelectedCells[0].OwningRow.Cells["RightID"].Value.ToString(); Master.frmRightsUpdate ifrmChild = new Master.frmRightsUpdate(this, rightID); ifrmChild.MdiParent = Program.MainForm; Program.MainForm.RegisterChild(ifrmChild); ifrmChild.Show(); } else { MessageBox.Show(Messages.Error.RowNotSelected); } }