Setting imageUrl client-side doesn't work

2 posts, 0 answers
  1. JP
    JP avatar
    122 posts
    Member since:
    Aug 2011

    Posted 26 Feb 2013 Link to this post

    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.
  2. JP
    JP avatar
    122 posts
    Member since:
    Aug 2011

    Posted 26 Feb 2013 Link to this post

    Found the problem: I was using a sort function afterwards - thereby the imageUrl got lost.
Back to Top