DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

How To Scroll Only Grid Data Without Header In Gridview

12.21.2011
| 2480 views |
  • submit to reddit
        This is very common problem in Web development that we need to freeze the GridView header at the time of scrolling, Here is one simple tips:
Step 1 : Create a CSS class as following

   
   .HeaderFreez  
   {  
    position:relative ;   
    top:expression(this.offsetParent.scrollTop);  
    z-index: 10;  
   }   
   

Step 2 Set Gridview’s HeaderStyle CssClass as follows
CssClass="HeaderFreez"
That’s all. Some times we need also maintain the scroll positions while selecting any data from GridView, and quite difficult to maintain the position while we are using AJAX

<a href="http://www.java-forums.org/blogs/spring-framework/"><strong>Spring Framework</strong></a>