Solved

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

Posted on 2009-04-09
2
1,652 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

623 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