Solved

How to apply vertical scrollbar to the gridview in asp.net 3.5

Posted on 2009-04-09
2
1,643 Views
Last Modified: 2012-05-06
i need only vertical scrollbar to the gridview.but header should be fixed while scrolling the vertical scrollbar
0
Comment
Question by:ravindra333
2 Comments
 
LVL 15

Accepted Solution

by:
spprivate earned 500 total points
ID: 24107747
You can also write the code like this:
The columns or rows which you want to be within scroll bars can be placed within a div tag.

<div style="overflow: auto; height: 35px; width: 100%" id="divRole" runat="server">
// Bind the column here
</div>

The other way is as in the snippet applying style
Use FIXED GRIDVIEW HEADER concept
 
put ur grid in a panel and appy a style sheet.
 
 
<asp:panel& ScrollBars="auto" CssClass="fixedHeader" Width="500px"
<asp:gridview & Width="500px"...............
 
 
<style type="text/css">
.fixedHeader
{
overflow: auto;
height: 200px;
width: 500px;
}
table th
{
border-width: 1px;
border-color:Gray;
background-color:plum;
position: relative;
top: expression(this.parentNode.parentNode.
parentNode.scrollTop-1);
}
</style>
Write this style in <head>

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question