gridview固定表头后 控件高度怎么随电脑不同象素而显示满屏高<div id="Grid" style="overflow-y:scroll;SCROLLBAR-SHADOW-COLOR: #bebebe; SCROLLBAR-3DLIGHT-COLOR: #bebebe; SCROLLBAR-ARROW-COLOR: #666666; SCROLLBAR-TRACK-COLOR: #f7f7f7; SCROLLBAR-DARKSHADOW-COLOR: #ffffff; height:485" onscroll="scroll()"> 
              <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="0" DataKeyNames="FUnitID" OnRowDataBound="GridView1_RowDataBound">
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <Columns>
                <asp:BoundField DataField="FNumber" HeaderText="单位编号" SortExpression="FNumber" >
                    <ItemStyle Width="100px" cssclass="selectbackground" />
                    <HeaderStyle Width="100px" cssclass="headbackground" />
                </asp:BoundField>
                <asp:BoundField DataField="FName" HeaderText="单位名称" SortExpression="FName" >
                    <ItemStyle Width="200px" cssclass="selectbackground" />
                    <HeaderStyle Width="200px" cssclass="headbackground" />
                </asp:BoundField>
                <asp:BoundField DataField="FDesc" HeaderText="说明">
                    <ItemStyle Width="300px" cssclass="selectbackground" />
                    <HeaderStyle Width="300px" cssclass="headbackground" />
                </asp:BoundField>
            </Columns>
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#DDDDDD" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#DDDDDD" HorizontalAlign="Left" />
            <HeaderStyle BackColor="#DDDDDD" Font-Bold="True" ForeColor="White" />
        </asp:GridView></div>如果我把height:485px改成height:100%后
滚动条就会出现问题
overflow-y请问如何根据电脑浏览器的象素显示满屏?(即height:485px自动取值)

解决方案 »

  1.   

    把<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">去掉,再用height:100%
      

  2.   

    去掉<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">后,还是无法显示网页是用iframe框架
      

  3.   

    去掉 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
    后panel会乱跑.不会居中
      

  4.   

    所有的ItemStyle和HeaderStyle 的width全换成百分比