public void btnAdd_Click(object sender, EventArgs e) { StudentAddUpdate StudentAddUpdateForm = new StudentAddUpdate(); StudentAddUpdateForm.Command = "Add New Student"; StudentAddUpdateForm.StudentListForm = this; dataGridView1.ClearSelection(); StudentAddUpdateForm.ShowDialog(); }
private void btnEdit_Click(object sender, EventArgs e) { StudentAddUpdate StudentAddUpdateForm = new StudentAddUpdate(); StudentAddUpdateForm.Command = "Update Student"; StudentAddUpdateForm.StudentListForm = this; StudentAddUpdateForm.StudentID = dataGridView1.SelectedRows[0].Cells["StudentID"].Value.ToString(); dataGridView1.ClearSelection(); StudentAddUpdateForm.ShowDialog(); }