I have a RadBinaryImage in a asp:Repeater template. I also have a RadBinaryImage in a RadRotator template. The Repeater works. The Rotator does not. What am I doing wrong?
In the following code, the Images collection contains objects that have a Byte[] property and a String property. The Byte[] is the contents of an image acquired by using an AsyncUpload control.
<
asp:Repeater
runat
=
"server"
ID
=
"AttachmentRepeater"
EnableViewState
=
"false"
>
<
ItemTemplate
>
<
telerik:RadBinaryImage
ID
=
"RadBinaryImage1"
runat
=
"server"
ResizeMode
=
"Fit"
DataValue='<%# Eval("Image")%>' Width="200" Height="200" />
</
ItemTemplate
>
</
asp:Repeater
>
<
telerik:RadRotator
ID
=
"thumbRotator"
runat
=
"server"
RotatorType
=
"ButtonsOver"
Width
=
"572"
Height
=
"118px"
ItemHeight
=
"118"
ItemWidth
=
"145"
FrameDuration
=
"1000"
ScrollDirection
=
"Left,Right"
OnItemClick
=
"ShowImage"
>
<
ItemTemplate
>
<
div
>
<
telerik:RadBinaryImage
ID
=
"RadBinaryImage2"
runat
=
"server"
ResizeMode
=
"Fit"
DataValue='<%# Eval("Image")%>' Width="200" Height="200" />
</
div
>
</
ItemTemplate
>
<
ControlButtons
LeftButtonID
=
"img_left"
RightButtonID
=
"img_right"
/>
</
telerik:RadRotator
>
In the following code, the Images collection contains objects that have a Byte[] property and a String property. The Byte[] is the contents of an image acquired by using an AsyncUpload control.
DataTable rotatorData = new DataTable();
rotatorData.Columns.Add("Image", typeof(System.Array));
rotatorData.Columns.Add("Name");
foreach (ImageInfo tempInfo in Images)
{
DataRow row = rotatorData.NewRow();
row["Image"] = tempInfo.Image;
row["Name"] = tempInfo.Name;
rotatorData.Rows.Add(row);
}
thumbRotator.DataSource = rotatorData;
thumbRotator.DataBind();