How to freeze GridView header

asp.netcontrolsgridview

As in a title, does anyone know how to freeze GridView header in ASP.NET ?

Best Solution

You can do it in the css

Freeze Header: 1. Define class .Freezing in Stylesheet:

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

2.Assign Datagrid Header's cssClass to Freezing