public void update() { try { Update_Product objForm = new Update_Product(p1, dataGridView1.SelectedRows[0].Cells[0].Value.ToString(), dataGridView1); objForm.Show(); } catch { MessageBox.Show("sorry no row found"); } }
public void update() { try { Update_Product objForm = new Update_Product(p1, dataGridView1.SelectedRows[0].Cells[0].Value.ToString(), dataGridView1); objForm.TopLevel = false; p1.Controls.Add(objForm); objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; objForm.Dock = DockStyle.Fill; this.Close(); objForm.Show(); } catch { MessageBox.Show("sorry no row found"); } }