Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-04-09
2
Medium Priority
?
1,657 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline

885 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