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

Display image in a combobox

3 Answers 140 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Marcia Marino
Top achievements
Rank 1
Marcia Marino asked on 24 Jan 2008, 07:09 AM
How do I display a Image that is storage in a database  on a combobox

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 24 Jan 2008, 01:49 PM
Hi Marcia Marino,

To be able to put an Image in a RadComboBox you should use Templates.

For reference, please view:

Templates Online Demo

Overview and when to use templates



Kind regards,
Simeon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Marcia Marino
Top achievements
Rank 1
answered on 25 Jan 2008, 08:07 AM
I have this on the aspx

<tr align="left" valign="top">

<td align="left" valign="top" style="white-space:nowrap;">

<asp:Label id="lblImages" runat="server" SkinID="LeftLabel" />

:

</td>

<td align="left" valign="top" style="white-space:nowrap;">

<telerik:RadComboBox Width="200px" Height="115px" ID="cbImages" Runat="server">

<ItemTemplate>

<img src='<%# "~/imagefetch.ashx?size=1&imageid=" + DataBinder.Eval(Container, "Attributes['id']") %>'>

<%

# DataBinder.Eval(Container, "Attributes['Title']") %>

</ItemTemplate>

</telerik:RadComboBox>

</td>

</tr>


and this on the codebehind

SqlDataSource1.ConnectionString = cxnstr;

SqlDataSource1.SelectCommand =

"SELECT title, id FROM albumimages WHERE (album = 1)";

cbImages.MarkFirstMatch = true;

cbImages.Skin =

"Vista";

The image does not appear, the image is storage on a database.

0
Simon
Telerik team
answered on 25 Jan 2008, 02:48 PM
Hi Marcia Marino,

Are you sure you have bound the RadComboBox control to a DataTable with the results from the query?
Because that may be the case. Otherwise your code looks Ok.

Sincerely yours,
Simeon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Marcia Marino
Top achievements
Rank 1
Answers by
Simon
Telerik team
Marcia Marino
Top achievements
Rank 1
Share this question
or