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

Displaying Image from SQL in Appointment

3 Answers 82 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 05 Aug 2012, 02:54 AM
Trying to display a Image from a SQL database, using the BinaryImage Control.  For some reason it doesn't display the image.

 

<ResourceTypes>

 

 

        <telerik:ResourceType DataSourceID="SqlDataSource1" ForeignKeyField="IMAGE"

 

 

            KeyField="IMAGE" Name="IMAGE" TextField="IMAGE" />

 

 

 

        </ResourceTypes>

 

 

<AppointmentTemplate>

 

 

    <h3>

 

        <%

# Eval("Subject") %>

 

 

    </h3>

 

 

    <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" DataValue='<%# Bind("IMAGE") %>'

 

 

        ImageHeight="20px" ImageWidth="20px" ResizeMode="Fit"/>

 

 

</AppointmentTemplate>

 

3 Answers, 1 is accepted

Sort by
0
Robert
Top achievements
Rank 1
answered on 05 Aug 2012, 01:03 PM
I think I know where my problem is at now, just don't know how to fix it.  It appears that I didn't set up the ResourceType correctly, but I don't see what I have wrong. 

 

<ResourceTypes>

 <telerik:ResourceType KeyField="UniqueKey" Name="IMAGE" TextField="IMAGE" ForeignKeyField="IMAGE"

 DataSourceID="ImageDataSource" />

 </ResourceTypes>
 

<

 

asp:SqlDataSource ID="ImageDataSource" runat="server"

 

 

ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

 

 

 

SelectCommand="SELECT UniqueKey, IMAGE FROM CALENDAR">

 

 

 

</asp:SqlDataSource>

 

0
Ivana
Telerik team
answered on 07 Aug 2012, 01:20 PM
Hello Robert,

The resources of RadScheduler take strings as a value whereas the DataValue property of RadBinaryImage takes byte[] as a value.
The following online demo shows an example of how to show the resources in an appointment template: http://demos.telerik.com/aspnet-ajax/scheduler/examples/customizeappointment/defaultcs.aspx.

Take a look RadBinaryImage's online demos for more information how to use it: http://demos.telerik.com/aspnet-ajax/binaryimage/examples/overview/defaultcs.aspx.

Regards,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Robert
Top achievements
Rank 1
answered on 07 Aug 2012, 01:55 PM
Is there a way to take the resourcetype field and convert it to a byte[] type?  That way it can be used as the input for the BinaryImage
Tags
Scheduler
Asked by
Robert
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Ivana
Telerik team
Share this question
or