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

  • Thread starter Thread starter Francois Verbeeck
  • Start date Start date
F

Francois Verbeeck

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","this.style.backgroundColor='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 asp.net 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.
 
Back
Top