Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Adding more than text to a CheckBoxList

Reply
Thread Tools

Adding more than text to a CheckBoxList

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      02-19-2010
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
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/

 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      02-21-2010


"Nathan Sokalski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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! |
************************************************

 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      02-21-2010
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?
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/

"Gregory A. Beamer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> "Nathan Sokalski" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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! |
> ************************************************


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding more than text to a CheckBoxList Nathan Sokalski ASP .Net 2 02-21-2010 04:55 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com Java 0 03-06-2008 08:11 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C++ 0 03-05-2008 08:41 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C Programming 0 03-05-2008 03:26 AM
Checkboxlist inside Repeater - doesn't fire click event for Checkboxlist JD ASP .Net 5 08-08-2007 11:28 AM



Advertisments