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

Add image to selected Item

4 Answers 119 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 30 Aug 2010, 09:11 PM
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.

4 Answers, 1 is accepted

Sort by
0
Accepted
Kalina
Telerik team
answered on 30 Aug 2010, 10:04 PM
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
0
Greg
Top achievements
Rank 1
answered on 31 Aug 2010, 03:50 PM
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>      

 

 

 

0
Kalina
Telerik team
answered on 02 Sep 2010, 10:00 PM
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
0
Greg
Top achievements
Rank 1
answered on 06 Oct 2010, 06:19 PM
Resolved.
Tags
ComboBox
Asked by
Greg
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Greg
Top achievements
Rank 1
Share this question
or