Display image in a combobox

4 posts, 0 answers
  1. Marcia Marino
    Marcia Marino avatar
    22 posts
    Member since:
    Jan 2006

    Posted 24 Jan 2008 Link to this post

    How do I display a Image that is storage in a database  on a combobox
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 24 Jan 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Marcia Marino
    Marcia Marino avatar
    22 posts
    Member since:
    Jan 2006

    Posted 25 Jan 2008 Link to this post

    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.

  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 25 Jan 2008 Link to this post

    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
Back to Top