Link to home
Start Free TrialLog in
Avatar of ndornack
ndornack

asked on

Radio Button "yes/no" Binding WinForms

I am new to radio button binding.  I have the following controls on my form:
gbWeldFixPic - Group Box Control
rbWeldFixPicNo - Radio Button Control - in gbWeldFixPic
rbWeldFixPicYes - Radio Button Control - in gbWeldFixPic

I have a field in sql that stored the value as a bit (field name:  engord.weldfixpic)

When I open the form for an existing order.... if my bit value is 1 then I want the rbWeldFixPicYes = checked, if my bit value is 0 then I want the rbWeldFixPicNo = checked.

What is a good way to implement this?  Please provide a working code example.
ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ndornack
ndornack

ASKER

I figured out a different way to do it, going along your thoughts though:

        private void rbWeldFixPicYes_CheckedChanged(object sender, EventArgs e)
        {
            if (rbWeldFixPicYes.Checked == true)
                newEngOrd.WeldFixPic = true;
            else
                newEngOrd.WeldFixPic = false;
        }

Thanks for your help