How do I create a repeater with fixed size that has scrollbars?

Posted on 2008-11-19
Last Modified: 2013-12-17
I would like to embed a repeater in my page that is 600x400. If the size of the repeater is greater than the defined size I would like scrollbars to appear.
Question by:tatton777
    LVL 22

    Accepted Solution

    Easiest way would be to wrap the repeater in a div with the overflow set in css:

    <div style="width:600px; height:400px; overflow:scroll;">

            <asp:Repeater ID="Repeater1" runat="server"></asp:Repeater>

    LVL 22

    Expert Comment

    Note that the div could also be set in the repeaters HeaderTemplate and FooterTemplate, but then it won't show up at all if the repeater doesn't have ANY data.
    LVL 1

    Author Comment

    Is there a way to get it to just pop up scrollbars for the vertical?
    LVL 22

    Expert Comment

    Try overflow:auto; instead of scroll.
    LVL 8

    Expert Comment

    by:Ashutosh Vyas
    Or if you are okay with using the Panels. I have been using it all along.

    <asp:Panel ID="pnlContainer" runat="Server" Width="100%" Height="300px" ScrollBars="Auto">
                <asp:Repeater.................................... />
    LVL 1

    Author Closing Comment

    Thanks for your help!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    This video discusses moving either the default database or any database to a new volume.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now