日期:2014-05-18  浏览次数:20334 次

GridView带横向和纵向滚动条时怎么固定头部。用C#.NET和asp画面的
GridView带横向和纵向滚动条时怎么固定头部呀,看了很多帖子,包括孟子老大的那个方法也试了,不行。改CSS的那个方法有横向滚动条时固定不住的。所以请教各位有什么办法固定住吗

------解决方案--------------------
<style> .fixedHeaderTr { background-color:whitesmoke; z-index:10; position:relative; top:expression(this.offsetParent.scrollTop); }
</style>

这个可以用
但就是当数据量大时速度慢,可以考虑用分页来解决速度慢的问题
------解决方案--------------------
用孟子的这个
http://dotnet.aspx.cc/article/7919da6b-9014-41c2-b9b6-10e5ec047f7d/read.aspx
绝对可用,我就是用这个的
------解决方案--------------------
http://www.codeproject.com/aspnet/FreezePaneDatagrid/FreezePaneDatagrid_src.zip
------解决方案--------------------
//固定表头,用Css
.fixedHeaderTr
{
background-color:whitesmoke;
z-index:10;
position:relative;
top:expression(this.offsetParent.scrollTop);
}