private void comboBoxGrade_SelectedIndexChanged(object sender, EventArgs e) { studyYears = AttendanceJournalDAL.GetStudyYears(this.TeacherID, (int)this.teacherGrades[comboBoxGrade.SelectedIndex].GradeNo, 7); if (studyYears.Count == 0) { studyYears.Add(GetCurrentStudyYear()); } UpdateComboStudyYear(); UpdateGridJournalData(); }
private void JournalViewWindow_Load(object sender, EventArgs e) { lblTeacher.Text = TeacherID.ToString(); foreach (Subject s in teacherSubjects) { comboBoxSubject.Items.Add(s.Title); } comboBoxSubject.SelectedIndex = 0; comboBoxSubject.SelectedIndexChanged += comboBoxSubject_SelectedIndexChanged; //init grade ComboBox foreach (Grade g in this.teacherGrades) { comboBoxGrade.Items.Add(g.ToString()); } comboBoxGrade.SelectedIndex = 0; //init study year combo box //comboStudyYear.DataSource = AttendanceJournalDAL.GetStudyYears(TeacherID, studyYears = AttendanceJournalDAL.GetStudyYears(this.TeacherID, (int)this.teacherGrades[comboBoxGrade.SelectedIndex].GradeNo, 7); //-------------------only this order UpdateComboStudyYear(); UpdateGridJournalData(); //------------------only this order gridJournal.AllowUserToAddRows = false; gridJournal.AllowUserToDeleteRows = false; this.gridJournal.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.gridJournal.ColumnHeadersHeight = 55; gridJournal.CellPainting += DataGridView_CellPaintingRotate; //rotate date header }