private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { try { panel3.Visible = true; USERID = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value.ToString()); var find = UserComponent.GetUserInformation(USERID); foreach (var item in find) { txt_EditPassword.Text = System.Text.Encoding.UTF8.GetString(item.UserPassWord); user = txt_EditUserName.Text = item.UserName; } panel3.Visible = true; txt_EditUserName.Focus(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }