private void button2_Click(object sender, EventArgs e) { frmAddPurchaseProduct frm = new frmAddPurchaseProduct(0, ""); frm.ShowDialog(); dataGridBind(); }
private void dgItemDetails_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (dgItemDetails.CurrentRow.Index != -1 && dgItemDetails.CurrentRow.Cells[1].Value != null) { var lID = Convert.ToInt32(dgItemDetails.CurrentRow.Cells[0].Value); frmAddPurchaseProduct frm = new frmAddPurchaseProduct(lID, ""); frm.ShowDialog(); dataGridBind(); } } catch (Exception x) { MessageBox.Show("Something went wrong. Contact your system administrator"); } }