Search code examples
asp.net-mvc-2comboboxtelerik-mvc

Telerik MVC Combobox - Change background of an item


I tried to change the hightlight of an item, it worked using:

            var combobox = $('#ComboBox').data('tComboBox');
            combobox.highlight(2);

The problem is I can only highlight on item!! Is there another way to change the background or font (bold) so the user can remember which item they have selected.
Thanks in advance.


Solution

  • Basically to mark an item as selected all you need is to add the 't-state-selected' class to it. So for example to make all the items in the dropdown area selected, you can get a reference like this to them and append the class:

    $('#ComboID').data().tComboBox.dropDown.$items.addClass('t-state-selected');