Click here to Skip to main content
15,886,815 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to set fixed height for header and footer in Gridview? Please help me
Posted

Hi,


Apply following css to your grid header and footer

C#
fixedheader
{
    background: url('Images/sprite.png') repeat-x 0px 0px;
    background-color: Gray;
    border-color: #989898 #cbcbcb #989898 #989898;
    border-style: solid solid solid none;
    border-width: 1px 1px 1px medium;
    color: #000;
    padding: 4px 5px 4px 10px;
    vertical-align: bottom;
    position: relative;
    top: expression(this.parentNode.parentNode.parentNode.scrollTop-2);
    left: expression(this.parentNode.parentNode.parentNode.scrollLeft);
}



and place following tag in your page head section


<meta http-equiv="X-UA-Compatible" content="IE=7" />

The above is working fine for me
Hope this helps.
 
Share this answer
 
Comments
kaarthick kanagaraj 13-Dec-11 4:36am    
How to use the expression ?
Please help
sriman.ch 13-Dec-11 5:08am    
Place above mentioned style in your css and assign that this to your gridview header

<HeaderStyle CssClass="fixedheader"/>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900