private void dgProductInfoRecord_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { try { DataGridViewRow aDataGridViewRow = dgProductInfoRecord.SelectedRows[0]; this.Hide(); ProductInfoUI aUi = new ProductInfoUI(); aUi.Show(); aUi.txtId.Text = aDataGridViewRow.Cells[0].Value.ToString(); aUi.comboCatagoryName.Text = aDataGridViewRow.Cells[1].Value.ToString(); aUi.comboProductName.Text = aDataGridViewRow.Cells[2].Value.ToString(); aUi.txtPrice.Text = aDataGridViewRow.Cells[3].Value.ToString(); aUi.btnDelete.Enabled = true; aUi.btnUpdate.Enabled = true; aUi.btnSave.Enabled = false; } catch (Exception exception) { MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ProductRecordUI_FormClosing(object sender, FormClosingEventArgs e) { ProductInfoUI aUi = new ProductInfoUI(); aUi.Show(); }
private void productInformationToolStripMenuItem_Click(object sender, EventArgs e) { ProductInfoUI aUi = new ProductInfoUI(); aUi.Show(); }