Is there a way to have the listbox alternate row colors? An type of slight row shading would work.
Thank you
Jeff
1 Answer, 1 is accepted
0
Nikolay
Telerik team
answered on 18 May 2020, 08:36 AM
Hello Jeffrey,
Alternating rows in the ListBox is not a built-in functionality, however, it can be easily achieved. The ListBox renders as an unordered list, thus the items list can be traversed and a custom CSS class appended applying the desired color. For example:
$('ul li').each(function(index, element) {
if( index % 2) {
var li = $(element).addClass("alternatingColor");
}
});
...
<style>
.alternatingColor {
background-color: aliceblue;
}
</style>
This can be examined live in the following Dojo demo:
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.