I'm using the RadRotator control to create a scrolling news area on my site. My database returns a data table of several rows, one row per news item. I'd like to be able to show 3 items per scrolling screen. What's the best way to do this?
5 Answers, 1 is accepted
0
Hello,
Set the ItemWidth and ItemHeight properties of the rotator to make all items have the same size. After that, set the Width and Height of the rotator so it can fit three items. For example if you set item size to be 100x100 pixels, the rotator needs to be 300x100 pixels. This way you can show three items at the same time.
Kind regards,
Lini
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Set the ItemWidth and ItemHeight properties of the rotator to make all items have the same size. After that, set the Width and Height of the rotator so it can fit three items. For example if you set item size to be 100x100 pixels, the rotator needs to be 300x100 pixels. This way you can show three items at the same time.
Kind regards,
Lini
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Samantha
Top achievements
Rank 1
answered on 28 Nov 2008, 03:32 PM
I mean how can I bind to the records though, is there a way I can declaratively bind to three records on the first screen, then the next three on the second screen?
0
Hello,
The number of rotator items you see on the screen is only dependent on the rotator and item size. The control will fit as many items as possible in the specified width and height. By default, the scrolling is done item by item - e.g. first you see items 1,2, and 3; then you see items 2,3, and 4; etc. If you wish to show items 1,2,3 and then 4,5,6 etc. you need to set the rotator mode to SlideShow. This way the rotator will scroll the whole viewport at once instead of item by item.
Regards,
Lini
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The number of rotator items you see on the screen is only dependent on the rotator and item size. The control will fit as many items as possible in the specified width and height. By default, the scrolling is done item by item - e.g. first you see items 1,2, and 3; then you see items 2,3, and 4; etc. If you wish to show items 1,2,3 and then 4,5,6 etc. you need to set the rotator mode to SlideShow. This way the rotator will scroll the whole viewport at once instead of item by item.
Regards,
Lini
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Samantha
Top achievements
Rank 1
answered on 09 Dec 2008, 09:40 PM
The problem is that I want one "feature" item with a large image, and the secondary records will just be text. Is this going to be possible?
0
Hi Samantha,
Here is how to achieve this - note the highlighted properties. The idea is to set the rotator to a certain width. Add one item that will have the same width so it can fill the viewport of the rotator. Then add an ItemTemplate and set its width to be 3 times less than the width of RadRotator.
All the best,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Here is how to achieve this - note the highlighted properties. The idea is to set the rotator to a certain width. Add one item that will have the same width so it can fill the viewport of the rotator. Then add an ItemTemplate and set its width to be 3 times less than the width of RadRotator.
<form id="form1" runat="server"> |
<asp:ScriptManager ID="SCriptManager1" runat="server"> |
</asp:ScriptManager> |
<telerik:RadRotator ID="RadRotator1" DataSourceID="AccessDataSource1" runat="server" |
Width="300px" Height="80px" ItemHeight="80" RotatorType="SlideShow" |
Skin="Sunset" AppendDataBoundItems="true"> |
<Items> |
<telerik:RadRotatorItem> |
<ItemTemplate> |
<asp:Label ID="Label2" runat="server" Width="300px">Feature Item</asp:Label> |
</ItemTemplate> |
</telerik:RadRotatorItem> |
</Items> |
<ItemTemplate> |
<asp:Label ID="lbl1" runat="server" Width="100px"> |
<%# DataBinder.Eval(Container.DataItem, "ProductName")%> |
</asp:Label> |
</ItemTemplate> |
</telerik:RadRotator> |
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb" |
SelectCommand="SELECT TOP 6 [ProductName], [UnitPrice], [UnitsInStock] FROM [Alphabetical List of Products]"> |
</asp:AccessDataSource> |
</form> |
All the best,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.