private void Cancel_BT_Click(object sender, EventArgs e) { //Clear textbox ClearData(); //Hide update button and show add button Up_BT.Hide(); Add_BT.Show(); }
private void AccGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { //Show Update button and hide add button Up_BT.Show(); Add_BT.Hide(); AdminCl admin = new AdminCl(); //bring data to the textboxes string UpdateRow = AccGridView.CurrentRow.Cells["Acc_ID"].Value.ToString(); Role_Cb.Text = admin.UpdateData(UpdateRow, "Role"); User_TB.Text = admin.UpdateData(UpdateRow, "Username"); Pass_TB.Text = admin.UpdateData(UpdateRow, "Password"); ID_TB.Text = admin.UpdateData(UpdateRow, "Acc_ID"); }