views:

340

answers:

1

I have asked this question before but did not get any correct answers.

I am using Vb.net for coding. I have a grid view control in which I want to introduce a vertical scroll bar if the value from the sql query overflows.

How do I go about it? I believe there is a javascript code for this

A: 
GridView inside <div > HTML tag
To produce GridView scrollbars with div tag, use this code:

<div style="width:100%; height:300; overflow:auto;">
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>

GridView inside Panel Control
To create GridView scrollbars with a little help of Panel control, use this code:

<asp:Panel ID="Panel1" runat="server" ScrollBars="Both" Height="300" Width="100%">
 <asp:GridView ID="GridView1" runat="server">
 </asp:GridView>
</asp:Panel>

http://www.beansoftware.com/ASP.NET-FAQ/GridView-ScrollBars.aspx

Henry Gao
sorry but the code didnt work
Peter