private void uiAddToolStripMenuItem_Click(object sender, EventArgs e) { var classTimeTableDayElem = (ClassTimeTableDayElem)uiMainDataGridView.SelectedCells[0].Value; var classTimeTable = classTimeTableDayElem.ClassTimeTable; using (var f = new ClassTimeTableAddForm(classTimeTable)) { f.IsEditMode = true; if (f.ShowDialog() == DialogResult.OK) { RefreshInfo(); } } }
private void uiMainDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (!Globals.IsRootMode) { return; } if (e.Button == MouseButtons.Left && e.RowIndex > -1 && uiMainDataGridView.Columns[e.ColumnIndex].DisplayIndex > 0) { var classTimeTableDayElem = (ClassTimeTableDayElem)uiMainDataGridView.SelectedCells[0].Value; var classTimeTable = classTimeTableDayElem.ClassTimeTable; using (var f = new ClassTimeTableAddForm(classTimeTable)) { f.IsEditMode = true; if (f.ShowDialog() == DialogResult.OK) { RefreshInfo(); } } } }