Solved

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

Posted on 2009-04-09
2
1,649 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

710 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