nested checkBoxLists

D

DJE2009

How does one nest checkboxlists?

Foreach business, listed in a checkboxlist, I want to display another
checkboxlist:

☑Business 1 ☑Physical ☑ Mailing ☑ Business ☑Records
☑Business 2 ☑Physical ☑ Mailing ☑ Business ☑Records
☑Business 3 ☑Physical ☑ Mailing ☑ Business ☑Records

So business names are listed vertically in the first checkboxlist and the
2nd checkboxlist is displayed horizontally. These are both bound
checkboxlists.

I've tried the following on the databound and databinding events:
CheckBoxList list = new CheckBoxList();
list.RepeatDirection = RepeatDirection.Horizontal;
list.DataSource = (DataSet)Cache["AddressTypeId"];
list.DataTextField = "Description";
list.DataValueField = "ID";
list.DataBind();
tbl1.FindControl("PlaceHolder1").Controls.Add(list);

This produces nothing on the screen but everything seems good in the debugger.

Can anyone tell me the right way to do this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top