Edit this page

Alternate Colors of DropDownList Items

Environment

Product Progress Kendo UI DropDownList
Operating System All
Browser All
Browser Version All

Description

How can I implement alternating colors in the items of a Kendo UI DropDownList?

Solution

Use the following CSS rules:

 #countries-list ul li:nth-of-type(odd) {
    background: lightblue;
 }
<div id="example">
  <div class="demo-section k-content">
    <h4>Products</h4>
    <input id="products" style="width: 100%" />
  </div>

  <script>
    $(document).ready(function() {
      $("#products").kendoDropDownList({
        dataTextField: "ProductName",
        dataValueField: "ProductID",
        dataSource: {
          transport: {
            read: {
              dataType: "jsonp",
              url: "https://demos.telerik.com/kendo-ui/service/Products",
            }
          }
        }
      });
    });
  </script>
  <style>
    #products-list ul li:nth-of-type(odd) {
      background: lightblue;
    }
  </style>
</div>

See Also

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy