Hi,
A. For freezing Headers:
Step 1: Create a CSS class
.HeaderFreeze
{
position:relative ;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
}
Step 2: Set Gridview’s HeaderStyle CssClass as follows
CssClass="HeaderFreeze"
B. For freezing Columns:
Step 1: Add locked Css:
td.locked, th.locked
{
position:relative;
left:expression ((this.parentElement.parentElement.parentElement.parentElement.scrollLeft-2)+'px');
}
Step 2: In RowDataBound event add css to GridView cell something like:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].CssClass = "locked";
}
}