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

basic problem : stop the rotator

2 Answers 79 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 24 Sep 2009, 10:17 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 24 Sep 2009, 11:25 AM
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.
0
Jon
Top achievements
Rank 1
answered on 24 Sep 2009, 11:29 AM
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
Tags
Rotator
Asked by
Jon
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jon
Top achievements
Rank 1
Share this question
or