By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,241 Members | 760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,241 IT Pros & Developers. It's quick & easy.

/!\ How to colorize selected checkbox in checkboxlist control ?

P: n/a
Dear UseNet readers,

Does anyone have any idea on how to colorize selected checkbox in
checkboxlist control ?

I've quite a huge checkboxlist (approximatively one full screen) and,
to improve user's experience, i wanted to highlight selected choices.
Does anyone know how to that ?

I can successfully do that on a datagrid by adding some code during
the ItemDatabound process

e.Item.Attributes.Add("onmouseover"," ckgroundColor='WhiteSmoke'");

but there is no "ItemDataBound function on the checkboxlist :( I tried
to do it on the SelectedIndexChanged but without success (i can't cast
a ListItem to a checkbox list so i'm not able to set a BackColor
property :(

Anyone knows a css trick to do that ? the right javascript code to add
at the right time ? I've been learning since only 2 months and
i feel sorry to ask such basic / pointless questions

Maybe i'll have to create a small datagrid with a hidden datavalue
column, a checkbox column and a datatextfield label column to cheat
this ...

Hope anyone can help.

Best Regards.
Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.