private void btnAdd_Click(object sender, EventArgs e) { MarksUIClick click = new MarksUIClick(); click.popUpAdd(); click.ShowDialog(); var bindingList = new BindingList <DTO>(lhr.GetMarksDatatable()); dataGridMarks.DataSource = new BindingSource(bindingList, null); dataGridMarks.ClearSelection(); _selectedMarksID = 0; _selectedRollNo = 0; _selectedSubject = null; _selectedSemester = null; _enteredMarksScored = 0; }
private void btnUpdate_Click(object sender, EventArgs e) { if (_selectedMarksID != 0) { MarksUIClick click = new MarksUIClick(); click.popUpUpdate(_enteredMarksScored, _selectedSemester, _selectedSubject, _selectedRollNo, _selectedMarksID, _selectedName); click.ShowDialog(); dataGridMarks.DataSource = new BindingSource(lhr.GetMarksDatatable(), null); dataGridMarks.ClearSelection(); _selectedMarksID = 0; _selectedRollNo = 0; _selectedSubject = null; _selectedSemester = null; _enteredMarksScored = 0; } else { MessageBox.Show("Please click any cell to update"); } }