RadRotator Slideshow Animation Crossfade from Codebehind

5 posts, 0 answers
  1. Kevin
    Kevin avatar
    28 posts
    Member since:
    Dec 2008

    Posted 28 Mar 2013 Link to this post

    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;
        }
  2. Kevin
    Kevin avatar
    28 posts
    Member since:
    Dec 2008

    Posted 29 Mar 2013 Link to this post

    Anyone?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 02 Apr 2013 Link to this post

    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.
  5. Colton3310
    Colton3310 avatar
    4 posts
    Member since:
    Jun 2013

    Posted 09 Aug 2013 Link to this post

    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.
  6. Colton3310
    Colton3310 avatar
    4 posts
    Member since:
    Jun 2013

    Posted 09 Aug 2013 Link to this post

    Thanks very much.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017