private void tsmAddFoodToolStripMenuItem_Click(object sender, EventArgs e) { FoodInfoForm frm = new FoodInfoForm(); frm.FormClosed += Frm_FormClosed; frm.Show(this); }
private void tsmUpdateFoodToolStripMenuItem_Click(object sender, EventArgs e) { if (dgvFoodList.SelectedRows.Count > 0) { DataGridViewRow selectrow = dgvFoodList.SelectedRows[0]; DataRowView rowview = selectrow.DataBoundItem as DataRowView; FoodInfoForm frm = new FoodInfoForm(); frm.FormClosed += new FormClosedEventHandler(Frm_FormClosed); frm.Show(this); frm.DisplayFoodInfo(rowview); } }