private void cmsGrid_EditQSO_Click(object sender, EventArgs e) { try { if (dgvSearch.SelectedRows == null) { return; } cQSO qso = dgvSearch.SelectedRows[0].DataBoundItem as cQSO; if (qso == null) { return; } frmQSO fq = new frmQSO(qso, _fMain); fq.Show(); } catch (Exception ex) { ErrMsg(ex.Message); } }
//QSOをダブルクリック private void dgvMain_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (dgvMain.SelectedRows == null) { return; } cQSO qso = dgvMain.SelectedRows[0].DataBoundItem as cQSO; if (qso == null) { if (_blQSOs.Count == 0) { qso = new cQSO(); } else { qso = new cQSO(_blQSOs[_blQSOs.Count - 1]); } } int[] iColW = new int[dgvMain.ColumnCount]; string[] sColN = new string[dgvMain.ColumnCount]; for (int i = 0; i < iColW.Length; i++) { if (dgvMain.Columns[i].Visible) { iColW[i] = dgvMain.Columns[i].Width; sColN[i] = dgvMain.Columns[i].HeaderText; } else { iColW[i] = -1; sColN[i] = "N/A"; } } frmQSO fq = new frmQSO(qso, _blQSOs, _dcDXCC, _dcCityCode, _dcBand, _dcMode, _dcDefault, iColW, sColN, _cfg); fq.Show(); } catch (Exception ex) { ErrMsg(ex.Message); } }
private void mnuAddNewQSO_Click(object sender, EventArgs e) { List <cQSO> lsAllQSO = new List <cQSO>(); foreach (cQSO q in _blQSOs) { lsAllQSO.Add(q); } cQSO NewQSO; if (0 < _blQSOs.Count) { NewQSO = new cQSO(_blQSOs[_blQSOs.Count - 1]); } else { NewQSO = new cQSO(); } int[] iColW = new int[dgvMain.ColumnCount]; string[] sColN = new string[dgvMain.ColumnCount]; for (int i = 0; i < iColW.Length; i++) { if (dgvMain.Columns[i].Visible) { iColW[i] = dgvMain.Columns[i].Width; sColN[i] = dgvMain.Columns[i].HeaderText; } else { iColW[i] = -1; sColN[i] = "N/A"; } } frmQSO f = new frmQSO(NewQSO, _blQSOs, _dcDXCC, _dcCityCode, _dcBand, _dcMode, _dcDefault, iColW, sColN, _cfg); f.Show(); }