1
Answer

filling in checkboxes and such from existing data

Baruch F

Baruch F

16y
1.9k
1
What is the recommended way to fill in radio buttons and checkboxes from existing data.  Is it just a bunch of if statements or is there something cleaner?  Like the following example;

if (rehabPrognosis == "01")
                rdo270RehabPrognosis1Good.Checked = true;
            else if (rehabPrognosis == "UK")
                rdo270RehabPrognosisUKUnknown.Checked = true;
            else if (rehabPrognosis == "00")
                rdo270RehabPrognosis0Guarded.Checked = true;

Thats just one set of radio buttons.  In my program I might have 100 such problems

Answers (1)