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;
- }
.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, I have written a complete article on
that, hope this will help Maintain GridView Scroll Position inside updatepanel