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

RadRotator Slideshow Animation Crossfade from Codebehind

4 Answers 94 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 28 Mar 2013, 06:53 PM
So here's the problem.  I can get the crossfade animation to work properly when I assign it to the page control ie.

<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;
    }

4 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 1
answered on 29 Mar 2013, 08:34 PM
Anyone?
0
Slav
Telerik team
answered on 02 Apr 2013, 03:50 PM
Hello Kevin,

As you can check in the attached sample page, the RadRotator CoverFlow animation functions in a standard setup even if the rotator is created on the code-behind. Please compare the sample with your actual project and check if there are differences in the setup.

If you are still having difficulties, try modifying the attached page so that the problem can be reproduced. In case this is not possible, you can also send a simple, fully runnable sample that isolates the issue so that I can inspect it locally and provide a concrete solution.

Kind regards,
Slav
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
Colton3310
Top achievements
Rank 1
answered on 09 Aug 2013, 06:16 AM
The code looks like so difficult. If you didn't solve the problem, you can try any other ways, such as flash slideshow maker, slideshow tool.
As the image slideshow lover, I suggest you Kvisoft slideshow software to make your animated photo slideshows.
0
Colton3310
Top achievements
Rank 1
answered on 09 Aug 2013, 06:17 AM
Thanks very much.
Tags
Rotator
Asked by
Kevin
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 1
Slav
Telerik team
Colton3310
Top achievements
Rank 1
Share this question
or