Daniel

Daniel

  • NA
  • 66
  • 0

CheckboxList items do not display text

Mar 11 2008 12:41 PM
I have a CheckboxList and am dynamically building it at runtime with the following code...

            for (int i = 0; i < dsReqsTaxonomy.TBQ_Attribute.Rows.Count; i++)
            {
                CheckBox cb = new CheckBox();
                cb.Name = "chk" + dsReqsTaxonomy.TBQ_Attribute.Rows[i]["Attribute_Name"];
                cb.Text = i.ToString();//dsReqsTaxonomy.TBQ_Attribute.Rows[i]["Attribute_Name"].ToString();
                chkAttributes.Items.Add(cb);
            }

When I test it, the CheckBoxList shows all the checkboxes with blank text in front of them.  It is just a list of blank checkboxes. 

Am I missing something?  Is the Text property the correct property to use?

Thanks in advance.

Daniel

Answers (1)