Link to home
Start Free TrialLog in
Avatar of Jimbo456
Jimbo456

asked on

Simple checkBox question

I have the following checkBox I am trying to display on my form but it show unchecked even though the data shows checked.

checkBox1.Text=datareader["Active"].ToString();

Any idea hoew to get it to properly display?

Jim
ASKER CERTIFIED SOLUTION
Avatar of tovvenki
tovvenki

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 warmach
warmach

You should not be setting the Text property at all.  This property is used as a label to the check box.  Link Venki said, you need to set the Checked property directly.  I would set the Text property to something more descriptive because it is something that the user will see.