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

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.
LVL 1
tatton777Asked:
Who is Participating?
 
Snarf0001Connect With a Mentor Commented:
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>

</div>
0
 
Snarf0001Commented:
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.
0
 
tatton777Author Commented:
Is there a way to get it to just pop up scrollbars for the vertical?
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
Snarf0001Commented:
Try overflow:auto; instead of scroll.
0
 
Ashutosh VyasFounder, InitQubeCommented:
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.................................... />
</asp:panel>
0
 
tatton777Author Commented:
Thanks for your help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.