private void iconButton4_Click(object sender, EventArgs e) // the rows that will be updating tech team { if (dgvTechTeam.SelectedCells.Count > 0) { int selectedrowindex = dgvTechTeam.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = dgvTechTeam.Rows[selectedrowindex]; string id = Convert.ToString(selectedRow.Cells["TechnicalID"].Value); string name = Convert.ToString(selectedRow.Cells["Name"].Value); string surname = Convert.ToString(selectedRow.Cells["Surname"].Value); string specialization = Convert.ToString(selectedRow.Cells["Specialization"].Value); string deployed = Convert.ToString(selectedRow.Cells["Deployed"].Value); string deployementDate = Convert.ToString(selectedRow.Cells["DeploymentDate"].Value); UpdateTechForm utf = new UpdateTechForm(); utf.SelectedTechValuess(id, name, surname, specialization, deployed, deployementDate); utf.FormClosed += new FormClosedEventHandler(ChildForm_Closed); utf.Show(); } }