private void dataGrid_content_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int temp = 0; if (entryType == JournalTask.EntryType.daily) { temp = JournalTask.GetCurrentTaskIds(selectedId).Count; } if (entryType == JournalTask.EntryType.monthly) { temp = JournalTask.GetMonthlyTaskIds(selectedId).Count; } if (entryType == JournalTask.EntryType.future) { temp = JournalTask.GetFutureTaskIds(selectedId).Count; } if (temp == 0) { return; } using (History history = new History(JournalTask.EntryType.daily, title, layer + 1, selectedId)) { history.OnTaskUndone += OnRefreshGrid; history.ShowDialog(); } }