private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            //edytuj studenta podwojnym klikiem
            Update_Student_Form updateStudentForm = new Update_Student_Form();

            updateStudentForm.textBoxID.Text                 = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            updateStudentForm.textBoxName.Text               = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            updateStudentForm.textBoxLastName.Text           = dataGridView1.CurrentRow.Cells[2].Value.ToString();
            updateStudentForm.textBoxPhone.Text              = dataGridView1.CurrentRow.Cells[5].Value.ToString();
            updateStudentForm.textBoxAdres.Text              = dataGridView1.CurrentRow.Cells[6].Value.ToString();
            updateStudentForm.dateTimePickerNewStudent.Value = (DateTime)dataGridView1.CurrentRow.Cells[3].Value;

            if (dataGridView1.CurrentRow.Cells[4].Value.ToString() == "Kobieta")
            {
                updateStudentForm.radioButtonFemale.Checked = true;
            }

            byte[] picture;
            picture = (byte[])dataGridView1.CurrentRow.Cells[7].Value;
            MemoryStream pic = new MemoryStream(picture);

            updateStudentForm.pictureBoxStudent.Image = Image.FromStream(pic);
            updateStudentForm.Show();
        }
示例#2
0
        private void edytujUsuńToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Update_Student_Form update_Student_Form = new Update_Student_Form();

            update_Student_Form.Show(this);
        }