So here's the problem. I can get the crossfade animation to work properly when I assign it to the page control ie.
However when I build the control from code behind it will not allow me to apply the cross fade, or rather I can apply the cross fade but it works just like a standard fade. Is there a work around or something that I can do to make sure the cross fade animation type gets applied when the control is built from code behind.
Below is what I am doing:
<
telerik:RadRotator
id
=
"RadRotator1"
runat
=
"server"
SlideShowAnimation-Type
=
"CrossFade"
></
telerik:RadRotator
>
However when I build the control from code behind it will not allow me to apply the cross fade, or rather I can apply the cross fade but it works just like a standard fade. Is there a work around or something that I can do to make sure the cross fade animation type gets applied when the control is built from code behind.
Below is what I am doing:
public
RadRotator GenerateRotatingBanner(SiteBanner banner)
{
RadRotator thisRotator =
new
RadRotator();
thisRotator.Width = Unit.Pixel(banner.BannerWidth);
thisRotator.ItemWidth = Unit.Pixel(banner.ImageWidth);
thisRotator.Height = Unit.Pixel(banner.BannerHeight);
thisRotator.ItemHeight = Unit.Pixel(banner.ImageHeight);
thisRotator.ScrollDuration = Convert.ToInt32(banner.TransitionTime * 1000);
thisRotator.FrameDuration = Convert.ToInt32(banner.FrameDelay * 1000);
thisRotator.PauseOnMouseOver =
false
;
thisRotator.ItemTemplate =
new
RotatorTemplate();
thisRotator.WrapFrames = banner.RotatingFrameWrap;
thisRotator.OnClientItemClicked +=
"OnClientItemClicked"
;
thisRotator.OnClientItemShowing +=
"ClientItemShowing"
;
switch
(banner.RotationType.ToLower())
{
case
"business card"
:
thisRotator.RotatorType = RotatorType.AutomaticAdvance;
switch
(banner.Direction.ToLower())
{
case
"up"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Up;
break
;
case
"down"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Down;
break
;
case
"left"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Left;
break
;
case
"right"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Right;
break
;
default
:
thisRotator.ScrollDirection = RotatorScrollDirection.Left;
break
;
}
break
;
case
"carousel"
:
thisRotator.RotatorType = RotatorType.Carousel;
break
;
case
"cover flow"
:
thisRotator.RotatorType = RotatorType.CoverFlow;
switch
(banner.Direction.ToLower())
{
case
"up"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Up;
break
;
case
"down"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Down;
break
;
case
"left"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Left;
break
;
case
"right"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Right;
break
;
default
:
thisRotator.ScrollDirection = RotatorScrollDirection.Left;
break
;
}
break
;
case
"slide show"
:
thisRotator.RotatorType = RotatorType.SlideShow;
thisRotator.SlideShowAnimation.Duration = Convert.ToInt32(banner.TransitionTime * 1000);
thisRotator.SlideShowAnimation.Type = Telerik.Web.UI.Rotator.AnimationType.CrossFade;
break
;
default
:
thisRotator.RotatorType = RotatorType.AutomaticAdvance;
switch
(banner.Direction.ToLower())
{
case
"up"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Up;
break
;
case
"down"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Down;
break
;
case
"left"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Left;
break
;
case
"right"
:
thisRotator.ScrollDirection = RotatorScrollDirection.Right;
break
;
default
:
thisRotator.ScrollDirection = RotatorScrollDirection.Left;
break
;
}
break
;
}
return
thisRotator;
}