0
我想獲得一個GridView CSS解決方案,讓固定標題能夠工作,但唯一能讓標題行與其他列對齊的唯一方法是使用position:relative,但隨後打破了我試圖實現的固定標題。最重要的調整看起來非常糟糕,標題的「單元格」似乎全部融合在一起。GridView固定標題CSS對齊
我的CSS:
.fixedHeader
{
font-weight:bold;
font-size:small;
position:absolute;
width:1070px;
text-align:justify;
background-color: #006699;
color: #ffffff;
height: 25px;
expression(Sys.UI.DomElement.getBounds(document.getElementById("Panel3")).y- 25);
}
我的GridView:
<asp:Panel ID="Panel3" runat="server" Height="354px" ScrollBars="Vertical"
Width="1070px" Font-Size="Small" onscroll="$get('MainContent_hdnScrollTop').value = this.scrollTop;">
<input type="hidden" id="hdnScrollTop" runat="server" value="0" />
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" AllowSorting="True" CellPadding="4"
ForeColor="#333333" GridLines="None"
onrowdatabound="GridView1_RowDataBound">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<HeaderStyle CssClass="fixedHeader" />
嗨,如果您嘗試使用此css方法,會出現很多問題。我正在使用第三方gridview控件。它只是asp.net網格視圖的擴展。 http://ideasparks.codeplex.com/ – Rohith 2013-05-29 10:07:25