CheckBoxList formatting

B

Buddy Ackerman

Is there any way to make the rows of a CheckboxList alternate the
background color like you can with a repeater?
 
S

S. Justin Gengo

Buddy, I don't think you can alternate the background color of the checkbox
itself. But you could certainly add div tags around each text item and
change the background color of that. Anything in the text area is rendered,
even html.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
Joined
Aug 5, 2007
Messages
1
Reaction score
0
Hey man,

Looks like this post is from a couple of years ago, but what the hey...

If alternating your bg color for each check box is still a priority, you'll have to write your own custom control. Alternating properties by item, in the same way the repeater and datalist allow, is beyond the scope of the control.

I would suggest creating a user control that is repeater / datalist based which manages a strongly-typed collection. You can use the findcontrol method of the repeater item to locate the value for each iteration, and you've accomplished what you set out to do - add alternating style control and still maintain the base functionality.

I hope this helps (sorry i'm late on it..)

Buck
 

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,796
Messages
2,569,645
Members
45,367
Latest member
Monarch

Latest Threads

Top