This is a migrated thread and some comments may be shown as answers.

Alternative background for list items

1 Answer 157 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Jianwei
Top achievements
Rank 1
Jianwei asked on 08 Jun 2015, 01:10 PM

I have a dropdown list and would like to style alternative items with different background colors, is there a way to do it in "CSS", I would try not to use Javascript do it. 

 

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Plamen Lazarov
Telerik team
answered on 08 Jun 2015, 02:52 PM

Hello Jianwei,

ComboBox and DropDownList list items are wrapped in a div with an id which is created from the id of the html element from which the widget is initialized and the string "-list". In other words if we use <input id="countries" /> to initialize a ComboBox or a DropDownList the div containing the <ul> with the list items will have countries-list as an Id.  

In order to achieve the desired result a CSS style could be applied to list items. Please refer to the example below:

http://dojo.telerik.com/@c0re/OKEVI

 

Regards,
Plamen Lazarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
DropDownList
Asked by
Jianwei
Top achievements
Rank 1
Answers by
Plamen Lazarov
Telerik team
Share this question
or