Click here to Skip to main content
15,898,718 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi all

i have a grid view in asp.net 3.5
now when the no. of columns increases (>3)
the my grid view comes out of pannel(at run time)
i want that when no. of columns increases
a slid bar comes like in datagridview in
window application

how it sud be done

thanxz in advance
Posted

If the size of the GridView is not large enough to display all the items, users can scroll horizontally or vertically by using scrollbars, which are provided by a ScrollViewer control. A ScrollBar is hidden if all the content is visible in a specific direction. Column headers do not scroll with a vertical scroll bar, but do scroll horizontally.
 
Share this answer
 
Gridview have not Scrollbar property so you have to use two things to achieve this

1 Div Tag

<div id="scrollP" style="overflow:scroll;height:100px;
width:200px;">
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>
2 Panel control

<asp:Panel ID="Panel1" ScrollBars="Both" runat="server" Width="220px">
<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