您的位置:首页 > 编程语言 > ASP

ASP.NET中GridView 表头不动内容滚动解决法

2008-03-11 10:09 399 查看
ASP.NET中GridView 表头不动内容滚动解决法

前台

<script>
function scrool()
{
var t = document.getElementById("<%=gvCheckList.ClientID%>");
var t2 = t.cloneNode(true)
for(i = t2.rows.length -1;i > 0;i--)
t2.deleteRow(i)
t.deleteRow(0)
head1.appendChild(t2)
}
window.onload = scrool
</script>

<div id="head1"></div>
<div style="height:186px;width:100%;overflow-y: scroll;">
<asp:GridView ID="GridView1" runat="server" Width="97%" >
<RowStyle Height="26px" />
<HeaderStyle BackColor="#EDEDED" Height="26px" />
</asp:GridView>
</div>

后台代码
Page_Load

this.GridView1.Attributes.Add("style", "table-layout:fixed");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐