private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            DataGridViewRow dr = dataGridView1.SelectedRows[0];

            this.Hide();
            frmUserRegistration frm = new frmUserRegistration();

            // or simply use column name instead of index
            //dr.Cells["id"].Value.ToString();
            frm.Show();
            frm.cmbUsertype.Text = dr.Cells[0].Value.ToString();
            frm.txtID.Text       = dr.Cells[1].Value.ToString();
            frm.UserID.Text      = dr.Cells[2].Value.ToString();

            frm.txtPassword.Text      = dr.Cells[3].Value.ToString();
            frm.txtUserName.Text      = dr.Cells[4].Value.ToString();
            frm.txtContact_no.Text    = dr.Cells[5].Value.ToString();
            frm.txtEmail_Address.Text = dr.Cells[6].Value.ToString();


            //frm.lblUser.Text = lblUser.Text;
            //frm.lblUserType.Text = lblUserType.Text;
            frm.btnDelete.Enabled   = true;
            frm.button1.Enabled     = true;
            frm.btnRegister.Enabled = false;
            frm.UserID.Focus();
        }
Beispiel #2
0
        private void registrationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmUserRegistration frm = new frmUserRegistration();

            frm.lblUser.Text     = User.Text;
            frm.lblUserType.Text = UserType.Text;

            frm.Show();
        }