private void AddStudentButton_Click(object sender, EventArgs e)
 {
     StudentDetailsForm addStudentForm = new StudentDetailsForm();
     addStudentForm.studentListForm = this;
     addStudentForm.Show();
     this.Hide();
 }
        private void AddStudentButton_Click(object sender, EventArgs e)
        {
            StudentDetailsForm addStudentForm = new StudentDetailsForm();

            addStudentForm.studentListForm = this;
            addStudentForm.Show();
            this.Hide();
        }
        private void StudentDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //if header row not Clicked and Details, Edit or Delete columns are clicked
            if ((e.RowIndex != -1) && (e.ColumnIndex > 3))
            {
                // Create the new studentDetailsForm
                StudentDetailsForm StudentDetails = new StudentDetailsForm();
                StudentDetails.studentListForm = this;//make a reference to this form
                StudentDetails.FormType = e.ColumnIndex; //send over the button that is clicked

                //get the student id from the studentsDataGridView

                StudentDetails.StudentID = Convert.ToInt32(StudentDataGridView.Rows[e.RowIndex].Cells["StudentID"].Value);
                //Debug.WriteLine(StudentDetails.StudentID);

                StudentDetails.Show(); // show the studenDerils FOrm
                this.Hide();//Hide this FOrm
            }
        }
        private void StudentDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //if header row not Clicked and Details, Edit or Delete columns are clicked
            if ((e.RowIndex != -1) && (e.ColumnIndex > 3))
            {
                // Create the new studentDetailsForm
                StudentDetailsForm StudentDetails = new StudentDetailsForm();
                StudentDetails.studentListForm = this;          //make a reference to this form
                StudentDetails.FormType        = e.ColumnIndex; //send over the button that is clicked

                //get the student id from the studentsDataGridView

                StudentDetails.StudentID = Convert.ToInt32(StudentDataGridView.Rows[e.RowIndex].Cells["StudentID"].Value);
                //Debug.WriteLine(StudentDetails.StudentID);

                StudentDetails.Show(); // show the studenDerils FOrm
                this.Hide();           //Hide this FOrm
            }
        }