Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
need to get scrolling option in grid view in place of pagersetting
Posted

Disable paging, place the gridview inside a DIV tag and set this style overflow:auto on the DIV.
ASP.NET
<div id="divGrid" style="overflow:auto;height:200px">
<asp:gridview xmlns:asp="#unknown">
</asp:gridview>
</div>
 
Share this answer
 
GridView still have not ScrollBars property. To create GridView with horizontal or vertical scrollbar you need to place GridView inside <div > tag or inside Panel control.
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>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900