Picking my Poison with RotatorType

2 posts, 0 answers
  1. Denny
    Denny avatar
    1 posts
    Member since:
    Oct 2011

    Posted 17 Oct 2011 Link to this post

    Basically, I want the type of animation featured in "Buttons" or "ButtonsOver", and I want to be able to scroll one index at a time.  I have 4 items displayed out of 6 possible, with wrap frames on.  Due to the nature of the web page that I'm displaying, that's exactly what I want.

    When I have 'buttons' turned on, and I click one of my image buttons, the control scrolls 6 indexes in that direction.  The result is something that looks very awkward and strange.  

    <telerik:RadRotator ID="RadRotator1" CssClass="bottom-Rotator" runat="server" Width="600px"
        ItemWidth="150" WrapFrames="true" ScrollDuration="500" PauseOnMouseOver="true" RotatorType="Buttons"
        ControlButtons-LeftButtonID="img_left" ControlButtons-RightButtonID="img_right">

    In conclusion, that's the animation style I want, and I do want to be able to click the control buttons to have to move the items in the control.  But I want to scroll 1 index at a time, and not 6.

    Moving onto ButtonsOver....

    This lets me scroll one index at a time.  Cool, exactly what I want.  However, this happens when I mouse-over the buttons, and not when I click.  This makes it awkward if I want to visit this site using a smartphone, because, in order to scroll, I have to touch the arrow buttons, then touch off the buttons in order to stop the scrolling.

    Basically what I would like is the ability to scroll one index at a time as if using buttonsOver, but only when I click the arrow keys, as in using buttons.  But there seems to be no way to do that, unless I am wrong, and I hope I am.  It seems weird to me that there is no way to control how many indexes I bypass when I click an arrow image.

    I could select "FromCode", and use javascript/vb.net functions to manually change the index, but wouldn't I lose my animation then?

    In conclusion, I'm looking for a solution that scrolls the items one at a time, when I click one of the set images, and still gives me the scrolling animation that's like "ButtonsOver".  Is that possible with this control?
  2. Slav
    Slav avatar
    1359 posts

    Posted 20 Oct 2011 Link to this post

    Hi Denny,

    The behavior you want to implement is possible by setting RotatorType="FromCode", as you correctly guessed. Then you can use the Client API of the control in order to move its items when clicking custom directional buttons. A similar scenario is shown in the online demo Rotator / Client-side API. Note that the client method showNext(direction), which scrolls the rotator control in the specified direction, is utilized and the animation of the RadRotator is not lost.

    For your convenience I have prepared also a sample project, implementing the suggested approach in a simpler scenario. Please use it as a reference for your further development.

    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
Back to Top