How to Create a Gridview with Scroll bar using ASP.NET 2.0 and C# is actually very simple. First, you will need to import the System.Data.SqlClient namespace for binding data to GridView. Then enclose your Gridview in a

tag and set the overflow style to auto/scroll.

We use the Page_Load event to bind the data. Then we can dynamically add style to GridView for layout.

The front end .aspx page looks something like this: DIV with “style=”overflow-y: scroll; height: 200px” in aspx page will create a scrollbar.

The flow for the code behind page is as follows.

Download Source Files