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

How to add icons to radcomobobox

1 Answer 412 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Avihai
Top achievements
Rank 1
Avihai asked on 31 Mar 2014, 06:41 PM
Hello,


I'm trying to add to radcomobobox icons but its not working

​<telerik:RadComboBox ID="rcbJobType" runat="server" EmptyMessage="Select Job Type" Width="248px">
<Items>
<telerik:RadComboBoxItem Text="Select Job Type" Value="Select Job Type" />
<telerik:RadComboBoxItem Text="Long Term" Value="Long Term" />
<telerik:RadComboBoxItem Text="Short Term" Value="Short Term" />
<telerik:RadComboBoxItem Text="Last Minute" Value="Last Minute" />
</Items>
</telerik:RadComboBox>


occurs on pageload
Protected Sub IconAttached()
Dim imgDir As New DirectoryInfo(Server.MapPath(Globals.gRootRelativeSecureURL("/Images/Layout/offDuty.png")))
For Each file As FileInfo In imgDir.GetFiles("*.png")
Dim item As New RadComboBoxItem(file.Name.Replace(".png", ""))
item.ImageUrl = "Img/" + file.Name
rcbEditJobType.Items.Add(item)

Next

****************using class for SecureURL for getting the image
               = "<img src='" + Globals.gRootRelativeSecureURL("/Images/Layout/offDuty.png") + "' border=""0"" align=""absmiddle"">"
End Sub

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 03 Apr 2014, 01:06 PM
Hello Avihai,

As I can see you are setting the Text of the RadComboBoxItems that you add, to the image path? Do you aim to have only images as RadComboBoxItems? In addition, please refer to this documentation article, demonstrating the approach for adding images to RadComboBoxItems.

Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ComboBox
Asked by
Avihai
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or