public void Initialize(bool enabled) { dtSubject = StaticSQLiteHelper.GetSubjectList(); subjects = new List <string>(); schedule = new Schedule(StaticSQLiteHelper.GetSchedule()); nightSchedule = new Schedule(StaticSQLiteHelper.GetNightSchedule()); AdjustDataGridView(); UpdateDataGridView(); if (enabled) { foreach (DataRow r in dtSubject.Rows) { subjects.Add(r[0].ToString()); } cbSubject.DataSource = subjects; } }