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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
private void rbWeldFixPicYes_CheckedCha
{
if (rbWeldFixPicYes.Checked == true)
newEngOrd.WeldFixPic = true;
else
newEngOrd.WeldFixPic = false;
}
Thanks for your help