public void Initialize() { styleForeColorRed = new DataGridViewCellStyle(); styleForeColorRed.ForeColor = Color.Red; schedule = new Schedule(StaticSQLiteHelper.GetSchedule()); nightSchedule = new Schedule(StaticSQLiteHelper.GetNightSchedule()); morningSchedule = new Schedule(StaticSQLiteHelper.GetMorningSchedule()); dgv.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; TestConflict(); lockedStyle = new DataGridViewCellStyle(); lockedStyle.BackColor = dgv.DefaultCellStyle.SelectionBackColor; lockedStyle.ForeColor = dgv.DefaultCellStyle.SelectionForeColor; LoadClassList(); adjustDataGridViewStyle(); loadClassSchedule(0); rbExchange.Checked = true; loadHistory(); }