1
Answer

CheckboxList items do not display text

Daniel

Daniel

16y
3.5k
1
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)