1.在.aspx页面添加下列代码
<script type="text/javascript">
function s() {
var t = document.getElementById("<%=GridView1.ClientID%>");
var t2 = t.cloneNode(true)
for (i = t2.rows.length - 1; i > 0; i--)
t2.deleteRow(i)
t.deleteRow(0)
a.appendChild(t2)
}
window.onload = s
</script>
2.在gridview中添加下列代码:
<div id="a">
</div>
3.即可固定表头行.