Hi,
Today I am here to share something to you. This is simpler as never but I bet, you are searching for this since long.
GridView with Scrollbars
If you have developed any web application using ASP.NET, you must have used GridView, if you are beginner and learning ASP.NET, this will tell you how to make display GridView with Scrollbars. As we know, we can Paginate data in GridView, but putting a Scrollbar is really confusing as it is not in default properties of GridView control.
Lets design a web form and insert a GridView. I am using no designs and just a form and dragged and auto formatted GridView control in this tutorial.
Lets see the code for this web form.
[html]
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="” SelectCommand=”SELECT * FROM [Districts]”>
[/html]
I have bind data from one of my projects, this is schema of Address and table is District List. Lets run the Web form, our output is:
[css]
..style=”height:400px; overflow:auto”..
//You can change overflow:auto to overflow:scroll but that will show both Scrollbar and always. Above will show Vertical Scrollbar only when the Height of GridView exceeds than assigned height.[/css]
Enjoy. Till then subscribe our feeds and get updated. You can also drop a comment below to suggest us improving.