private void menuItem12_Click(object sender, EventArgs e) { frmInstruments objfrmInstruments = new frmInstruments(); objfrmInstruments.MdiParent = this; objfrmInstruments.FormMode = FormMode.Edit; objfrmInstruments.Show(); }
private void dgvMeasurements_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == dgvMeasurements.Columns["btnInstrumentColumn"].Index) { Measurement objMeasurement = dgvMeasurements.CurrentRow.DataBoundItem as Measurement; if (objMeasurement != null) { frmInstruments objfrmInstruments = new frmInstruments(objMeasurement.InstrumentID); objfrmInstruments.db = db; objfrmInstruments.FormMode = FormMode.Select; objfrmInstruments.ShowDialog(); if (objfrmInstruments.SelectedInstrument != null) { objMeasurement.InstrumentUsed = objfrmInstruments.SelectedInstrument; dgvMeasurements.CurrentRow.Cells["btnInstrumentColumn"].Value = objMeasurement.InstrumentUsed.InstrumentID; } } } }