basic problem : stop the rotator

3 posts, 1 answers
  1. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 24 Sep 2009 Link to this post

    Hi,

    This is probably really quick and simple but I couldn't see an answer.

    My rotator displays two entries at a time.  I need to say that if the count is less than 3 don't rotate.  at teh moment the rotation still occurs and as such the two items switch place which looks a bit stupid.

    Is there some way of setting the rotator to not rotate.  Obviously I could set the frame duration to some silly value to get around this. 

    I need to do this from the code behind.

    Regards,

    Jon
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Sep 2009 Link to this post

    Hi Jon,

    One suggestion is you can stop the Rotator when the number of items is less than 3 from clientside as shown below. Attach OnClientLoad event to RadRotator.

    JavaScript:
     
    function OnClientLoad(sender, args) { 
        
        itemCount = sender.get_items().length; 
        if (itemCount<3) 
        { 
            sender.stop(); 
        } 

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 24 Sep 2009 Link to this post

    Hi Shinu,

    Good timing with that one , I'd just come up with a server side work around.  When there is less than 3 items I just set the rotator type to FromCode and obviosly I don't have the code implemented to advance the items. 

    In my case the better solution is the server code given that I do the databinding at the server but for a vanilla rotator with no code behind stuff I think your solution would be better.

    Many thanks,

    Jon
Back to Top