样式:
<style type="text/css">
th{
position:relative;
top:expression(this.offsetParent.scrollTop);
}
</style>
页面:
<div style="position:relative;width:100% ;overflow:scroll;margin:0px;padding:0px;">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" style="border:solid 0px #99bbe8;padding:0px; height:700px;margin:0px;" >
<ContentTemplate>
<asp:GridView ID="gv_List" runat="server" Width="100%" Style="text-align: center;"
OnRowDataBound="gv_List_RowDataBound" OnRowCreated="gv_List_RowCreated" CellPadding="4"
ForeColor="#333333" GridLines="None">
<Columns>
</Columns>
<RowStyle CssClass="RowCss" BackColor="#EFF3FB" Height="20px" Wrap="False" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#acd7f5" Font-Bold="True" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
<EmptyDataTemplate>
<table style=" width: 100%;height:100px;border:solid 0px;">
<tr>
<td style="background-color:#f2f2f2;text-align:center;border:solid 0px;">
暂时无数据! </td>
</tr>
</table>
</EmptyDataTemplate>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>