Adding more than text to a CheckBoxList

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

I have a CheckBoxList and I want more than just text in some of the items.
However, because the ListItem, which is used to add the CheckBoxes, does not
allow child controls, I cannot find a way to do this. Any ideas? Thanks.
 
Nathan Sokalski said:
I have a CheckBoxList and I want more than just text in some of the items.
However, because the ListItem, which is used to add the CheckBoxes, does
not allow child controls, I cannot find a way to do this. Any ideas?
Thanks.

I can think of a few ways. One is to use a control like a Repeater that
gives you full control of the HTML output and can be altered with each item
quite easily. This is by taking control of the binding. Another option,
perhaps, is to change the style and use CSS to deliver the other content
(images?).


--
Peace and Grace,
Greg

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

************************************************
| Think outside the box! |
************************************************
 
Interesting ideas, but unfortunately neither one will work. The Repeater
would not work in my situation because I am not using DataBinding for the
CheckBoxList, and the Repeater does not have the built-in properties for
dealing with checkboxes that I like about the CheckBoxList. CSS will not
work because there is no way to get the child controls into the ListItem,
which means that in the generated HTML, the controls that I wanted to make
child controls are outside of the table that the CheckBoxList generates
(therefore, the "child" controls aren't really children at all). And without
the "child" controls inside the same td tag as the generated input and label
tag, CSS becomes pretty useless as far as putting the "child" controls where
I want. Any other ideas?
 
Back
Top