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

RadComboBox not displaying images and text

1 Answer 74 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Gitanjali
Top achievements
Rank 1
Gitanjali asked on 15 Jan 2009, 01:04 PM
i have used radcombobox to display images with text, but its unable to display both images and text, please suggest me whats wrong in my code.
following is the code :-

<

telerik:RadComboBox ID="cmbNewShortcut" runat="server" Width="200px"

 

 

Skin="Gray" MarkFirstMatch="false" HighlightTemplatedItems="True"

 

 

ShowToggleImage="True" AllowCustomText="false" EnableLoadOnDemand="false">

 

 

<ItemTemplate>

 

 

<div>

 

 

<img src='../Images/<%# DataBinder.Eval(Container, "Attributes['ImagePath']") %>' alt="" />

 

 

<span ><%# DataBinder.Eval(Container, "Text") %></span>

 

 

</div>

 

 

</ItemTemplate>

 

 

<Items>

 

 

<telerik:RadComboBoxItem ImagePath="customer.jpg"

 

 

Text="Customer" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="contacts.png"

 

 

Text="Contact" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="supplier.jpg"

 

 

Text="Supplier" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="contract.jpg"

 

 

Text="Contract" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="product.png"

 

 

Text="Product" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="order.jpg"

 

 

Text="Order" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="admin.jpg"

 

 

Text="People" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="serialno.ico"

 

 

Text="Serial No" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="Cases.png"

 

 

Text="Case" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="task.jpg"

 

 

Text="Task" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="document.gif"

 

 

Text="Document" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="invoice.png"

 

 

Text="MRN" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="dc.png"

 

 

Text="Delivery Challan" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="installation.png"

 

 

Text="Installation" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

<telerik:RadComboBoxItem ImagePath="invoice.png"

 

 

Text="Invoice" Value="1002">

 

 

</telerik:RadComboBoxItem>

 

 

</Items>

 

<

CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

 

</telerik:RadComboBox>

 

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 15 Jan 2009, 02:34 PM
Hello Gitanjali,

You need to call the DataBind() method of the combobox in the Page_Load event.

You can also check this demo (see the last combo) which shows the usage of the ImageUrl property of the RadComboBoxItem.

Sincerely yours,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Gitanjali
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or