PDA

View Full Version : Apply a Different CSS on some Listbox Items



christophe.bousquet
20 Feb 2009, 1:44 AM
Hello EveryBody,

I would like to put a different css to my listbox, depending on the Item's value.




Lisbox lb = new Listbox();
lb.add("Item1","1");
lb.add("Item2","2");
lb.add("Item3","3");
lb.add("Item4","1");

In this example it would means that items with value "1" get red background and "2" gets a blue one.

I tried many ways to get it works but did not find.

Thanks in advance.