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

Standalone RadBinaryImage

5 Answers 89 Views
BinaryImage
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 16 Aug 2010, 07:04 PM
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!

5 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 16 Aug 2010, 07:10 PM
...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;
    }
}
0
Rosen
Telerik team
answered on 17 Aug 2010, 10:58 AM
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
0
Cori
Top achievements
Rank 2
answered on 17 Aug 2010, 06:17 PM
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.
0
Scott
Top achievements
Rank 1
answered on 17 Aug 2010, 06:54 PM
Thank you for the replies.  I was able to achieve my goal using an ASP Image control and an HttpHandler.
0
Phil
Top achievements
Rank 2
answered on 31 Aug 2010, 07:28 PM
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
Tags
BinaryImage
Asked by
Scott
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Rosen
Telerik team
Cori
Top achievements
Rank 2
Phil
Top achievements
Rank 2
Share this question
or