样式:
1
.FixGridHeaderAbove
2 {
3 text-align: center;
4 font-weight:bold;
5 background-color:#C0C0FF;
6 POSITION: relative;
7 TOP: expression(this.offsetParent.scrollTop) ;
8}
2 {
3 text-align: center;
4 font-weight:bold;
5 background-color:#C0C0FF;
6 POSITION: relative;
7 TOP: expression(this.offsetParent.scrollTop) ;
8}
代码:
1
<
div
style
="OVERFLOW: auto; HEIGHT: 380px; WIDTH: 500;"
align
="center"
>
2 < asp:DataGrid id ="DataGrid1" runat ="server" >
3 < HeaderStyle CssClass ="FixGridHeaderAbove" ></ HeaderStyle >
4 </ asp:DataGrid >
5 </ div >
2 < asp:DataGrid id ="DataGrid1" runat ="server" >
3 < HeaderStyle CssClass ="FixGridHeaderAbove" ></ HeaderStyle >
4 </ asp:DataGrid >
5 </ div >