Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now