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

Is there a way to have a gap on the trailing edge of the Rotator?

2 Answers 32 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
George Mariakis
Top achievements
Rank 1
George Mariakis asked on 23 Aug 2011, 04:36 PM
I am trying to include a gap at the trailing edge of the rotator much like the leading gap on the Live XML example. The rotator is a vertical scroll up. When the rotator first starts up there's a leading blank, or gap, that is about the height of the control itself. I am wondering how to do this for the trailing edge. I have constantly changing list, but the gap should just be as tall as the control height. (For background, I am rendering live scores and I only render an entrant once we have a score so the list grows over time to consist of the entire entry list).

Currently I have tried to "add" blank entries to the end on the client side event OnClientLoad, but this only causes the leading gap to disappear and forces the items to "jump" up and not scroll properly. 

var itemsinrotator = rot.getItemHtmlElements().length;
 
for (var i = 0; i < itemsinrotator; i++) {
    rot.addRotatorItem("<div height='64'> </div>", 0);
}


Please advise on the best way to accomplish a trailing gap and once that gap has fully rendered (i.e. the height of the control), then trigger the full rotation as outlined here: http://www.telerik.com/community/forums/aspnet-ajax/rotator/load-fresh-data-after-one-full-rotation.aspx

The format should look like this:

Leading Edge Gap (height of control)
....
List of items
....
Trailing Edge Gap (height of control)
trigger that the scroll is complete (http://www.telerik.com/community/forums/aspnet-ajax/rotator/load-fresh-data-after-one-full-rotation.aspx)
...
Repeat with new data

Thank you.

Regards,
George


2 Answers, 1 is accepted

Sort by
0
Accepted
Slav
Telerik team
answered on 26 Aug 2011, 12:10 PM
Hello George,

You can achieve the desired effect by adding empty items to the RadRotator, as you correctly guessed. In order to ensure that the rotator will start over after the last blank item is displayed, you don't need to trigger the rotation manually. Just verifying that the property WrapFrames is set to true will be enough.

My suggestion is to add the empty items on the code-behind, since items inserted via the client-side property addRotatorItem will not exist in the rotator's items collection on the server. So, on the server-side you can add three instances of the RadRotatorItem class at the end of the Items collection of the RadRotator, so that the edge gap has the height of the rotator's viewport.

In order to demonstrate the suggested approach, I have attached a sample project to this post. Please use it as a basis for your further development.

I hope the provided solution meets your requirements. Feel free to contact us again, should you encounter more problems.

All the best,
Slav
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
George Mariakis
Top achievements
Rank 1
answered on 29 Aug 2011, 06:11 PM
That did the trick. Thank you Slav.

Regards,
George
Tags
Rotator
Asked by
George Mariakis
Top achievements
Rank 1
Answers by
Slav
Telerik team
George Mariakis
Top achievements
Rank 1
Share this question
or