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

.GridView表头固定 GridView在iframe里面
用的是webipstin的方法

  <style     > .Freezing     {    
                      TABLE-LAYOUT:     fixed;     Z-INDEX:     10;     POSITION:     relative;     ;     TOP:     expression(this.offsetParent.scrollTop)    
}    
.Freezing     TH     {    
                      PADDING-RIGHT:     2px;     PADDING-LEFT:     2px;     PADDING-BOTTOM:     2px;     OVERFLOW:     hidden;     PADDING-TOP:     2px;     WHITE-SPACE:     nowrap    
}    
                                                  </style     >    


    <asp:GridView     BorderStyle= "none "   ID= "GridViewList1 "     runat= "server "   >
          <HeaderStyle   CssClass= "Freezing "   />
                </asp:GridView>


这样把GridView放在某一单独页面是没有问题
但是放在比如a.aspx中
<tr> <td> <iframe= 'a.aspx '> </td> <td> <iframe= 'b.aspx '> </td> </tr>
这样表头固定就无法实现...

------解决方案--------------------
如果你在a.aspx中设置呢?或者在td中处理?样式是很灵活的东西,这个应该是有办法达到你效果的
------解决方案--------------------
iframe貌似无法获取a.aspx的样式

要么用用户控件 要么直接在a.aspx也用

------解决方案--------------------
让frame自适应宽度 试试呢
<iframe name= "myframe " src= "a.aspx " frameborder= "0 " scrolling= "auto " width= "100% " height= "100% " onload= "document.all[ 'myframe '].style.width=myframe.document.body.scrollWidth " > </iframe>
------解决方案--------------------
马甲..
------解决方案--------------------
看看这个行不行
http://blog.csdn.net/cpp2017/archive/2007/02/03/1501636.aspx