private void comboBoxSemester_SelectionChangeCommitted(object sender, EventArgs e) { //MessageBox.Show("SelectionChangeCommitted.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); comboBoxSection.DataSource = null; comboBoxSection.Items.Clear(); comboBoxSubject.DataSource = null; comboBoxSubject.Items.Clear(); //comboBoxSection.Items.Remove(1); //for (int i = 0; i < comboBoxSection.Items.Count; i++) //{ // comboBoxSection.Items.RemoveAt(i); //} //comboBoxSection.Items.Remove(comboBoxSection.SelectedItem); Controller.Section section = new Controller.Section(); Controller.Subject subject = new Controller.Subject(); section.LoadAllSection(1, Convert.ToInt32(comboBoxSemester.SelectedValue), comboBoxSection); subject.LoadAllSubject(1, Convert.ToInt32(comboBoxSemester.SelectedValue), comboBoxSubject); }