private void PlansListGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1 && PlansListGridView.CurrentCell.Value.ToString() != "N/A" && e.ColumnIndex != 0) { IList <DayPlan> dayPlans = intersection.WholeWeeksDayPlan[e.RowIndex + 1]; DayPlan dp = dayPlans[e.ColumnIndex - 1]; PlanDetailsForm pf = new PlanDetailsForm(intersection, dp); pf.ShowDialog(); } }
private void PatternDataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1 && PatternDataGridView.CurrentCell.Value.ToString() != "N/A") { //IList<DayPlan> dayPlans = intersection.WholeWeeksDayPlan[e.RowIndex + 1]; //DayPlan dp = dayPlans[e.ColumnIndex]; DayPlan dp = new DayPlan(); dp.DayPlanName = PatternDataGridView.CurrentCell.Value.ToString(); dp.DayPlanActionId = e.RowIndex * 9 + e.ColumnIndex + 1; //Schedule sc = new Schedule(DateTime.Now, DateTime.Now); //sdp.Schedule = sc; TimingPlan tp = intersection.AllTimings[e.RowIndex * 9 + e.ColumnIndex]; dp.TimingPlan = tp; PlanDetailsForm pf = new PlanDetailsForm(intersection, dp); pf.ShowDialog(); } }