Help with highlighting rows with mouseover of a checkbox list web control?

vcharles
vcharles used Ask the Experts™
on
Hi,

When I place my mouse over a row, only the checkbox is highlighted, how do you also highlight the text in the row?

V.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ramkisan JagtapLead Developer

Commented:

Author

Commented:
Thanks for the code. Do you know the vb.net version of the code below?

foreach (ListItem item in CheckBoxList1.Items)
             {
                 item.Attributes.Add("onmouseover", "javascript:this.className = 'itemStyle'");
                 item.Attributes.Add("onmouseout", "javascript:this.className = ''");
             }
Lead Developer
Commented:
For Each item As ListItem In CheckBoxList1.Items
      item.Attributes.Add("onmouseover", "javascript:this.className = 'itemStyle'")
      item.Attributes.Add("onmouseout", "javascript:this.className = ''")
Next
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Author

Commented:
Thanks!

Author

Commented:
Hi,

Is their a way to applly the code below for all checkbox list control on my form? instead of repeating the code for each control.

For Each item As ListItem In CheckBoxList1.Items
      item.Attributes.Add("onmouseover", "javascript:this.className = 'itemStyle'")
      item.Attributes.Add("onmouseout", "javascript:this.className = ''")
Next

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial