private void LoadCourseFee_dataGridView() { courseFee_dataGridView.DataSource = Course_Methods.LoadDataGridView("course"); courseFee_dataGridView.DefaultCellStyle = new DataGridViewCellStyle() { Font = new Font("Times New Roman", 10, FontStyle.Regular), }; }
private void add_new_course_tabControl_Selected(object sender, TabControlEventArgs e) { if (add_new_course_tabControl.SelectedIndex == 0) { changeBackColor(course_nm_textBox, course_nm_alias_textBox, total_sem_numericUpDown); CourseDetails_dataGridView.DataSource = Course_Methods.LoadDataGridView("course"); } else if (add_new_course_tabControl.SelectedIndex == 1) { changeBackColor(subject_code_textBox, subject_nm_textBox, select_sem_numericUpDown); //fuction to load data in datagridview refresh_SubjectDataGridView(); subjectDetails_dataGridView.DefaultCellStyle = new DataGridViewCellStyle() { Font = new Font("Times New Roman", 10, FontStyle.Regular), }; #region Code to load Course name & it's according semester in "Subject detail tabpage" this.course_nm_comboBox.TextChanged -= new EventHandler(this.subject_controls_textChanged); dt_loadDetails = Course_Methods.Load_CourseDetails("subject"); if (dt_loadDetails.Rows.Count > 0) { select_sem_numericUpDown.Enabled = true; course_nm_comboBox.DisplayMember = "Alias"; course_nm_comboBox.ValueMember = "TotalSem"; course_nm_comboBox.DataSource = dt_loadDetails; } else { select_sem_numericUpDown.Enabled = false; course_nm_comboBox.Items.Add("Select Course"); course_nm_comboBox.SelectedIndex = 0; } this.course_nm_comboBox.TextChanged += new EventHandler(this.subject_controls_textChanged); #endregion } else if (add_new_course_tabControl.SelectedIndex == 2) { changeBackColor(select_course_comboBox, set_fee_textBox); #region code to load Course Alias in "Course fee tabpage" this.select_course_comboBox.TextChanged -= new EventHandler(this.subject_controls_textChanged); loadingCourseDetails(); LoadCourseFee_dataGridView(); this.select_course_comboBox.TextChanged += new EventHandler(this.subject_controls_textChanged); #endregion } }
private void loadCourse() { dt_course = Course_Methods.LoadDataGridView("course"); Course_dataGridView.DataSource = dt_course; Course_dataGridView.AutoGenerateColumns = false; if (!Course_dataGridView.Columns.Contains("remove")) { DataGridViewLinkColumn dc = new DataGridViewLinkColumn() { Text = "Remove", HeaderText = "Edit", Name = "remove", UseColumnTextForLinkValue = true, LinkColor = Color.Crimson, LinkBehavior = LinkBehavior.HoverUnderline }; Course_dataGridView.Columns.Insert(Course_dataGridView.Columns.Count, dc); } }
private void LoadCourseFee_dataGridView() { DataTable dt = Course_Methods.LoadDataGridView("course"); fee_dataGridView.DataSource = dt; if (dt.Rows.Count > 0) { select_course_comboBox3.DataSource = dt; select_course_comboBox3.DisplayMember = "CourseAlias"; } else { select_course_comboBox3.SelectedIndex = 0; } set_fee_TextBox.DataBindings.Clear(); set_fee_TextBox.DataBindings.Add("TEXT", dt, "Fees"); fee_dataGridView.DefaultCellStyle = new DataGridViewCellStyle() { Font = new Font("Times New Roman", 10, FontStyle.Regular), }; }
private void refresh_SubjectDataGridView() { dt_loadDGV = Course_Methods.LoadDataGridView("subject"); subjectDetails_dataGridView.DataSource = dt_loadDGV; dt_loadDGV.DefaultView.RowFilter = "CourseAlias = '" + course_nm_comboBox.Text + "'"; }