How to add icons to radcomobobox

2 posts, 0 answers
  1. Avihai
    Avihai avatar
    21 posts
    Member since:
    Aug 2013

    Posted 31 Mar 2014 Link to this post

    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
  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 03 Apr 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top