关于GridView表头固定的问题 可参考http://forums.microsoft.com/msdn-cht/ShowPost.aspx?PostID=1293020&SiteID=14 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用css试试,我用的挺好。<style type="text/css"> .Freezing { position:relative ; table-layout:fixed; top:expression(this.offsetParent.scrollTop); z-index: 10; } .Freezing th{text-overflow:ellipsis;overflow:hidden;white-space: nowrap;padding:1px;}</style> 然后在gridview的<HeaderStyle CssClass="Freezing" />中加上css就行了。<asp:GridView ID="GridView1" runat="server"> <HeaderStyle CssClass="Freezing" /> <Columns> …… </Columns> <EmptyDataTemplate> <span style="font-size: 11pt; color: #ff3300"> 当前没有信息! </span> </EmptyDataTemplate></asp:GridView> 用css试试,我用的挺好。<style type="text/css"> .Freezing { position:relative ; table-layout:fixed; top:expression(this.offsetParent.scrollTop); z-index: 10; } .Freezing th{text-overflow:ellipsis;overflow:hidden;white-space: nowrap;padding:1px;}</style> 然后在gridview的<HeaderStyle CssClass="Freezing" />中加上css就行了。<asp:GridView ID="GridView1" runat="server"> <HeaderStyle CssClass="Freezing" /> <Columns> …… </Columns> <EmptyDataTemplate> <span style="font-size: 11pt; color: #ff3300"> 当前没有信息! </span> </EmptyDataTemplate></asp:GridView> 感谢楼上的兄台,这个方法已经能满足我的要求了但是我还有一个问题,就是我的GridView的Header的文字很长,能不能让它换行显示呢 请问这个js为什么不能实现倒计时 js设置图片的路径 [玻璃鱼V]JS关于字符替换的问题 请问jquery 如何选择 所有没有'disabled'的选项? 如何使按键没有响应 请教meizz,如何在你的TreeView里动态的加一个node 关于多选列表的问题 疑义相与析(第一期):征集常见问题 juery中的.text()使用后标签消失了 js对象操作问题 自定义表单 csdn论坛头像上面的特效:鼠标移动到头像弹出div已经做好了··但是怎么控制弹出div的位置呀···
<style type="text/css">
.Freezing
{
position:relative ;
table-layout:fixed;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
} .Freezing th{text-overflow:ellipsis;overflow:hidden;white-space: nowrap;padding:1px;}
</style>
然后在gridview的<HeaderStyle CssClass="Freezing" />中加上css就行了。
<asp:GridView ID="GridView1" runat="server">
<HeaderStyle CssClass="Freezing" />
<Columns>
……
</Columns>
<EmptyDataTemplate>
<span style="font-size: 11pt; color: #ff3300">
当前没有信息! </span>
</EmptyDataTemplate>
</asp:GridView>
<style type="text/css">
.Freezing
{
position:relative ;
table-layout:fixed;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
} .Freezing th{text-overflow:ellipsis;overflow:hidden;white-space: nowrap;padding:1px;}
</style>
然后在gridview的<HeaderStyle CssClass="Freezing" />中加上css就行了。
<asp:GridView ID="GridView1" runat="server">
<HeaderStyle CssClass="Freezing" />
<Columns>
……
</Columns>
<EmptyDataTemplate>
<span style="font-size: 11pt; color: #ff3300">
当前没有信息! </span>
</EmptyDataTemplate>
</asp:GridView>