Standalone RadBinaryImage

6 posts, 0 answers
  1. Scott
    Scott avatar
    5 posts
    Member since:
    Feb 2009

    Posted 16 Aug 2010 Link to this post

    I need to display an image based on a PK ID on a form.  All of the demos/example code seems to utilize an image within a grid (or other data-related item).  Is there any possibility of using a RadBinaryImage as a standalone control?

    Thanks!
  2. Scott
    Scott avatar
    5 posts
    Member since:
    Feb 2009

    Posted 16 Aug 2010 Link to this post

    ...or is it possible to set the DataValue in a JScript function?

    Something along the lines of:

     

    showImg: function (byt)
    {
        var img = $get('radImg');
      
        if (byt)
        {
            img.DataValue = byt;
        }
    }
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 17 Aug 2010 Link to this post

    Hi Scott,

    Indeed RadBinaryImage is a stand-alone control and can be used as such. You just need feed the binary data into the DataValue property. Unfortunately you can do this only server-side. 

    Best wishes,
    Rosen
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 17 Aug 2010 Link to this post

    To set the RadBinaryImage in the server-side, all you need to do is pass the image bytes to the DataValue property and then call DataBind() on the RadBinaryImage control to get it to display the image.

    I hope that helps.
  6. Scott
    Scott avatar
    5 posts
    Member since:
    Feb 2009

    Posted 17 Aug 2010 Link to this post

    Thank you for the replies.  I was able to achieve my goal using an ASP Image control and an HttpHandler.
  7. Phil
    Phil avatar
    273 posts
    Member since:
    Jul 2008

    Posted 31 Aug 2010 Link to this post

    Hi:

    What about a FormView control as follows:
    <asp:FormView
        id="mImageFormView" runat="server"
        DataSourceID="mImageDataSource" >
        <ItemTemplate>
            <telerik:RadBinaryImage ID="rbiThumbnail" runat="server" Width="180px" Height="220px"
                DataValue='<%# Eval("Thumbnail") %>' AlternateText='No image'
                />
        </ItemTemplate>
    </asp:FormView>
    Phil
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017