I'm trying to hightlight the RadComboItems with the following code:
(It is simplified to point out my problem; multiple strings "country" will be fetched from the database based on e.Text, obviously).
| protected void cbxCountry_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) |
| { |
| RadComboBox combo = (RadComboBox)o; |
| combo.Items.Clear(); |
| RadComboBoxItem item = new RadComboBoxItem(); |
| HtmlGenericControl span = new HtmlGenericControl(); |
| string country = "Spain"; |
| span.InnerHtml = System.Text.RegularExpressions.Regex.Replace(country, e.Text, "<em>" + e.Text + "</em>"); |
| item.Controls.Add(span); |
| item.Text = country; |
| combo.Items.Add(item); |
| } |
It seems to work; I'm totally free in what content to put in an item, even images.
Unfortunately, it does not highlight when the mouse hovers over the item or when keydown is pressed.
Do I have to <class> attribute somewhere?