CSS Code,
/*Css for header*/
th
{
cursor:pointer;
background-repeat:no-repeat ;
background-position: 98% 20%;
background-color:Gray;
}
.header
{
font-weight:bold;
position:absolute;
background-color:gray;
}
/*Css for rows*/
.Row
{
color:Black;
background-color:white;
}
/*Css for header row1*/
.Captionrow
{
font-weight:bold;
cursor:pointer;
background-color:Gray;
background-repeat:no-repeat ;
height:20px;
}
/*Css for header2*/
.Cntrlrow
{
font-weight:bold;
background-color:gray;
background-repeat:no-repeat ;
height:20px;
}
.grid-header
{
font-weight: bold;
font-family: Verdana;
font-size: 11px;
background-color: #7A9FCB;
text-decoration: underline;
color: #ffffff;
text-align: left;
position: relative;
top:expression(this.parentNode.parentNode.parentNode.scrollTop-2);
left:expression(this.parentNode.parentNode.parentNode.scrollLeft-1);
right:1px;
}
ASP.Net code:
<asp:GridView ID="grvCtrl" runat="server" ClientIDMode="static" ShowFooter="True" Visible="true" HtmlEncoded ="true" ShowHeader ="true">
<RowStyle CssClass="Row" />
<HeaderStyle CssClass="grid-header"></HeaderStyle> </asp:GridView>