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");
前台
<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");
相关文章推荐
- ASP.NET中GridView 表头不动内容滚动解决法
- 用CSS实现GridView 内容滚动而表头不动
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- ASP.NET控件开发之ScrollGridView(兼容FF、IE、苹果、谷歌、搜狗,固定表头滚动的GridView控件)
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]
- ASP.net中Gridview修改表头后没有排序功能的解决方法
- Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]