Multiple DB records needed per "screen"

6 posts, 0 answers
  1. Samantha
    Samantha avatar
    50 posts
    Member since:
    May 2008

    Posted 25 Nov 2008 Link to this post

    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?
  2. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 28 Nov 2008 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Samantha
    Samantha avatar
    50 posts
    Member since:
    May 2008

    Posted 28 Nov 2008 Link to this post

    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?
  5. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 02 Dec 2008 Link to this post

    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.
  6. Samantha
    Samantha avatar
    50 posts
    Member since:
    May 2008

    Posted 09 Dec 2008 Link to this post

    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?
  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 10 Dec 2008 Link to this post

    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.

    <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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017