private void BtnAdd_Click(object sender, EventArgs e) { frmADDorEDIT myfrm = new frmADDorEDIT(); if (myfrm.ShowDialog() == DialogResult.OK) { Bindgrid(); } }
private void BtnEdit_Click(object sender, EventArgs e) { if (MydataGridView.CurrentRow != null) { int customerId = int.Parse(MydataGridView.CurrentRow.Cells[0].Value.ToString()); frmADDorEDIT myfrm = new frmADDorEDIT(); myfrm.customerId = customerId; if (myfrm.ShowDialog() == DialogResult.OK) { Bindgrid(); } } }