Guest User

Guest User

  • Tech Writer
  • 529
  • 40.6k

RadioButton Yes/No Set on selectedindex change Help me?

Jan 12 2022 10:30 PM
private void drp_Volunteer_SelectedIndexChanged(object sender, EventArgs e) {
    ConfigurationDAL dAL = new ConfigurationDAL();
    DataTable dt = new DataTable();
    drp_Volunteer.DataSource = dt;
    drp_Volunteer.ValueMember = "volunteerid";

    dt = dAL.FetchVolunteerDetails(volunteerID: 12012).Tables[0];
    foreach (DataRow dr in dt.Rows)
    {
        txt_FirstName.Text = dr["firstname"].ToString();
        txt_fatherName.Text = dr["middlename"].ToString();
        txt_Surname.Text = dr["surname"].ToString();
        txt_ReportDisplayName.Text = dr["reportdisplayname"].ToString();
        txt_Address.Text = dr["address"].ToString();
        txt_Cnic.Text = dr["cnic"].ToString();
        txt_HomePhone.Text = dr["homephonenumber"].ToString();
        txt_MobilePhone.Text = dr["mobilephonenumber"].ToString();
        txt_EmailAddress.Text = dr["emailaddress"].ToString();
        txt_AcademicQualification.Text = dr["academicqualification"].ToString();
        txt_ReligiousQualification.Text = dr["religiousqualification"].ToString();
        drp_MaritalStatus.Text = dr["maritalstatus"].ToString();
        drp_MedicalInsurance.Text = dr["ismedicalinsurance"].ToString();
        drp_BloodGroup.Text = dr["bloodgroup"].ToString();
        txt_LastTimeBloodDonated.Text = dr["lasttimeblooddonated"].ToString();
        txt_Occupation.Text = dr["occupation"].ToString();
        txt_FirmName.Text = dr["firmname"].ToString();
        txt_Designation.Text = dr["designation"].ToString();
        txt_WorkAddress.Text = dr["workaddress"].ToString();
        drp_Group.Text = dr["groupname"].ToString();
        dtp_DateOfBirth.Text = dr["dateofbirth"].ToString();
        txt_DateOfJoining.Text = dr["dateofjoining"].ToString();
        drp_CurrentPosition.Text = dr["volunteerpositionid"].ToString();
        txt_PrevInstitutionName.Text = dr["previnstitutionname"].ToString();
        dtp_PrevInstitutionJoiningDate.Text = dr["previnstitutionjoiningdate"].ToString();
        txt_PrevInstitutionLeavingDate.Text = dr["previnstitutionleavingdate"].ToString();

        //radio button set her

        agar value 1 hai to yes par check ho jaye 
        agar value 0 hai to no par check ho jaye

        database say check kar cha rha ho

        drp_LeavingOfReason.Text = dr["isresign"].ToString();
        dtp_DateOfLeaving.Text = dr["dateofleaving"].ToString();
        byte[] imgs = (byte[])dr["profilephoto"];
        MemoryStream ms = new MemoryStream(imgs);
        ProfilePicture.Image = Image.FromStream(ms);
    }
}

yeah raidobutton list hai yeah sub check karna na hai           

Rbtn_FireFightingYes.Checked = false;
Rbtn_FireFightingNo.Checked = false;

Rbtn_FirstAidYes.Checked = false;
Rbtn_FirstAidNo.Checked = false;

Rbtn_EnglishLanguageYes.Checked = false;
Rbtn_EnglishLanguageNo.Checked = false;

Rbtn_BombDisposalYes.Checked = false;
Rbtn_BombDisposalNo.Checked = false;

Rbtn_CertYes.Checked = false;
Rbtn_CertNo.Checked = false;

Rbtn_SecurtiyYes.Checked = false;
Rbtn_SecurityNo.Checked = false;

 


Answers (2)