Aligning a dynamically created web label control beside a dynamic checkboxlist

I am using VS 2003. I have a web page in ASP.NET which includes a label. This label is created using HTML. This label is called tierContainer. It is used to hold dynamically created labels and checkboxes. The dynamic controls are created in C# in a dll. The labels are to proceed each checkbox list. These controls are dynamic because the number created is based on how many items are selected in a listbox. So if there are 2 items selected in a listbox, there will be 2 labels and 2 checkbox lists inside of the tierContainer. I have been successful in making that work properly. The problem I am having is aligning the labels in front and on the same row of the checkbox list. For some reason, the label in on the line preceding the checkbox list.

So I have just given you a snippet of code that aligns the text to the left of the checkbox. You will obviously need to add the headings for each row which i'm sure you will be able to do without much trouble.

Sean, you are using a checkbox control and I am using a checkbox list. Can you please take the code that you have and help me figure out how to implement it in the code I have above? I'm having a hard time making it work with the code I have.

I am having trouble making this work. Your solution is using tables where as I have a textbox which holds the checklists. I would have to do a major rewrite in order to implement the tables instead of the textbox container. Is there a way to implement this using my current code...the container textbox that holds the label and checklist controls?

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

I'm here playing with Firebug. This is neat. I have found that for some reason the checkboxlist is included in a table and the labels I created are not. I did not create these tables. They are automatically generated. I think that is what's causing the labels to appear separately.

I feel really stupid cause I just can't get it to work. When I do a float right, all of my labels are still on the line above the checkboxes and they are jammed all together into one word. The checkboxlist is all aligned right, but now they are out of order and again still on the line below the labels. I am still stuck. I don't know how to do this without rewriting all my code. I seen somewhere about using the label's .associatedcontrolid. But I couldn't get that to work. I guess because I am adding the label control and checkboxlist control separately to the label container. Why does this have to be so hard?

Well, believe it or not I finally got the label to align on the same line as the checkbox. I created a table in the code behind and simply put the label in one cell and the checkbox list in another cell. You had the idea with your TestTheRender function but I didn't have to deal with the parsing or odd/even stuff. I didn't have to deal with any formating for the table or stylesheets either. However my results from the query isn't coming back now. I guess I have some code somewhere else I need changed. That was why I didn't want to have to deal with a table. I knew it would break my code.

Now I have to figure out which answer to accept as a solution. Any ideas? And thanks again for everything. You were the only one who helped.

I just got my query to work now. Everything is working perfectly. It was tough. I chalk it up to a learning experience. I wasn't used to getting controls from a table. The reason I wasn't getting results from my query after making the change was because you have to drill down to the cell level to get the control. Just trying to do a findcontrol from the table gives you the rows. Thanks so much!

Featured Post

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Introduction
This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks.
Background
I had to provide a way for user…

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …

Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail. The methods are covered in more detail in o…