private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { UpdateStudentForm updateS = new UpdateStudentForm(); updateS.textBoxID.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); updateS.textBoxFname.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); updateS.textBoxLname.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); updateS.dateTimePicker1.Value = (DateTime)dataGridView1.CurrentRow.Cells[3].Value; if (dataGridView1.CurrentRow.Cells[4].Value.ToString() == "Female") { updateS.radioButton2.Checked = true; } updateS.textBoxPhone.Text = dataGridView1.CurrentRow.Cells[5].Value.ToString(); updateS.textBoxAddress.Text = dataGridView1.CurrentRow.Cells[6].Value.ToString(); byte[] pic; pic = (byte[])dataGridView1.CurrentRow.Cells[7].Value; MemoryStream picture = new MemoryStream(pic); updateS.pictureBoxUploadImage.Image = Image.FromStream(picture); updateS.Show(); }
private void manageStudentsFormToolStripMenuItem_Click(object sender, EventArgs e) { UpdateStudentForm usf = new UpdateStudentForm(); usf.Show(this); }