This is a migrated thread and some comments may be shown as answers.

Setting imageUrl client-side doesn't work

1 Answer 60 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 26 Feb 2013, 11:02 AM
Hello,

I'm adding new values to the comboBox client-side, including an icon. Unfortunately, the image won't work. In fact, all icons of already existing items (which were added server-side) disappear. The imageUrl is correct, I also used the imageUrl of the currently selectected item.

This is my code:
var caption = "Test";
var id = "123";
var img = "inc/img/Ps/Img1.png"
 
  var items = this.get_comboBox().get_items();
      this.get_comboBox().trackChanges();
      var comboItem = new Telerik.Web.UI.RadComboBoxItem();
      comboItem.set_text(caption);
      comboItem.set_value(id);
      comboItem.set_imageUrl(img);
 
      items.add(comboItem);
      this.get_comboBox().commitChanges();

Am I missing something?

Edit: If I don't set the ImageUrl to the client-side item, the other icons disappear anyway.

1 Answer, 1 is accepted

Sort by
0
JP
Top achievements
Rank 1
answered on 26 Feb 2013, 03:27 PM
Found the problem: I was using a sort function afterwards - thereby the imageUrl got lost.
Tags
ComboBox
Asked by
JP
Top achievements
Rank 1
Answers by
JP
Top achievements
Rank 1
Share this question
or