Add image to selected Item

5 posts, 1 answers
  1. Greg
    Greg avatar
    22 posts
    Member since:
    Aug 2010

    Posted 30 Aug 2010 Link to this post

    I have followed the example here: http://demos.telerik.com/aspnet-ajax/combobox/examples/programming/customattributes/defaultvb.aspx

    This adds images to each item nicely. However, I am not sure how to add an image to the selected item. In other words, if you go to the above link and change the avatar combo box selection, it shows text. I would like the selected item to show an image as well.

    Is this possible?

    Also, after adding an item template, the highlight no longer appears when hovering over items.
  2. Answer
    Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 30 Aug 2010 Link to this post

    Hello Greg,


    This code library project illustrates how to show the image of the selected Item in the RadComboBox input.
    Additionally - in order to highlight hovered RadComboBox items - please set the HighlightTemplatedItems property of the control to "True".

    Kind regards,
    Kalina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Greg
    Greg avatar
    22 posts
    Member since:
    Aug 2010

    Posted 31 Aug 2010 Link to this post

    Thank you! That was precisely what I needed.

    I am still having a little trouble with aligning the text to be indented off of the image. I followed this example: http://www.telerik.com/community/code-library/aspnet-ajax/combobox/show-the-selected-item-image-in-input.aspx
    This won't indent the text.

     

     

     

    <style type="text/css">
        .cbGeographicUnit .rcbInputCell .rcbInput
        {
            padding-left: 22px;
        }
    </style>
      
    <tr>
        <td>
        <telerik:RadComboBox ID="cbGeographicUnit" OnClientLoad="showFirstItemImage" OnClientSelectedIndexChanging="showImageOnSelectedItemChanging" HighlightTemplatedItems="true">
                            <ItemTemplate>
                                ...
                            </ItemTemplate>
                        </telerik:RadComboBox>
             </td>
    </tr>      

     

     

     

  4. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 02 Sep 2010 Link to this post

    Hi Greg,

    Could you please follow this forum thread? Your question has been already answered there.

    All the best,
    Kalina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Greg
    Greg avatar
    22 posts
    Member since:
    Aug 2010

    Posted 06 Oct 2010 Link to this post

    Resolved.
Back to Top