private void btnEditUser_Click(object sender, EventArgs e) { frmEditUser fu = new frmEditUser(); fu.txtName.Text = dgvUser.CurrentRow.Cells[3].Value.ToString(); fu.txtUsername.Text = dgvUser.CurrentRow.Cells[0].Value.ToString(); fu.txtPassword.Text = dgvUser.CurrentRow.Cells[1].Value.ToString(); fu.cbQuyen.SelectedValue = dgvUser.CurrentRow.Cells[2].Selected; fu.ShowDialog(); HienThiDuLieu(); }
DialogResult EditUser(UserInfo contact) { if (contact == null) { return(DialogResult.Ignore); } DialogResult ret = DialogResult.Cancel; Cursor.Current = Cursors.WaitCursor; using (frmEditUser frm = new frmEditUser(contact, OwnerForm.Ribbon)) { ret = frm.ShowDialog(OwnerForm); } UpdateCurrentContact(); Cursor.Current = Cursors.Default; return(ret); }