private void buttonEdit_Click(object sender, EventArgs e)
        {
            this.Close();
            Edit_Remove_Swimmer editRemoveSwimF = new Edit_Remove_Swimmer();

            editRemoveSwimF.Show();
        }
        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            //displaying the selected student in a new form to edit/remove
            Edit_Remove_Swimmer editRemoveSwimF = new Edit_Remove_Swimmer();

            editRemoveSwimF.textBoxId.Text    = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            editRemoveSwimF.textBoxFname.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            editRemoveSwimF.textBoxLname.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString();

            //gender
            if (dataGridView1.CurrentRow.Cells[3].Value.ToString() == "Female")
            {
                editRemoveSwimF.radioButtonFemale.Checked = true;
            }

            editRemoveSwimF.dateTimePicker1.Value = (DateTime)dataGridView1.CurrentRow.Cells[4].Value;
            editRemoveSwimF.textBoxAge.Text       = dataGridView1.CurrentRow.Cells[5].Value.ToString();
            editRemoveSwimF.textBoxSchool.Text    = dataGridView1.CurrentRow.Cells[6].Value.ToString();
            editRemoveSwimF.textBoxMedical.Text   = dataGridView1.CurrentRow.Cells[7].Value.ToString();
            editRemoveSwimF.textBoxSwmT.Text      = dataGridView1.CurrentRow.Cells[8].Value.ToString();
            editRemoveSwimF.textBoxGroup.Text     = dataGridView1.CurrentRow.Cells[9].Value.ToString();
            editRemoveSwimF.textBoxPname.Text     = dataGridView1.CurrentRow.Cells[10].Value.ToString();
            editRemoveSwimF.textBoxPaddress.Text  = dataGridView1.CurrentRow.Cells[11].Value.ToString();
            editRemoveSwimF.textBoxPnum.Text      = dataGridView1.CurrentRow.Cells[12].Value.ToString();
            editRemoveSwimF.textBoxPemail.Text    = dataGridView1.CurrentRow.Cells[13].Value.ToString();
            editRemoveSwimF.Show();
        }
Exemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            Edit_Remove_Swimmer editRemoveSwim = new Edit_Remove_Swimmer();

            editRemoveSwim.Show();
        }