- - PR -
GridViewのヘッダー固定について
1
投稿者 | 投稿内容 |
---|---|
|
投稿日時: 2008-10-02 19:43
ASP.NET 2.0 にて、GridViewを置いて、ヘッダー固定にしています。
GridViewのヘッダー固定時、明細を下にスクロールするとヘッダーの上に明細行が少し (0.5mm程度ですが)はみ出たような状態となってしまいます。 スクロールしてもヘッダーの上に明細行がはみ出ないようにしたく、ネットでいろいろ 調べたのですが、分かりません・・・ なにかいい方法はないでしょうか? 見にくいですが、以下に実際に記述しているaspxファイルのコードを記載します。 <div id="freezingDiv1" style="OVERFLOW: auto; position: absolute; WIDTH: 950px; HEIGHT: 261px; left: 26px; top: 336px;" runat="server"> <asp:GridView ID="SPD_MAIN" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" CellSpacing="1" EnableViewState="False" Font-Size="12px" ForeColor="Black" GridLines="Vertical" style="z-index: 100; left: 8px; top: 185px; table-layout: fixed;" Height="12px"> <HeaderStyle BackColor="#C0FFC0" BorderColor="Black" CssClass="headerstyle_freezing" Font-Bold="True" ForeColor="White" Height="15px" HorizontalAlign="Center" /> <FooterStyle BackColor="#CCCCCC" /> <Columns> <asp:BoundField DataField="NO" HeaderText="No"> <ItemStyle HorizontalAlign="Right" /> <HeaderStyle Width="25px" /> </asp:BoundField> <asp:BoundField DataField="OKYAKU_NO" HeaderText="お客様コード"> <HeaderStyle Width="69px" /> </asp:BoundField> <asp:BoundField DataField="KYAKU_RANK" HeaderText="ランク"> <ItemStyle HorizontalAlign="Center" /> <HeaderStyle Width="30px" /> </asp:BoundField> <asp:BoundField DataField="IRI_SIMEI" HeaderText="依頼主名"> <HeaderStyle Width="220px" /> </asp:BoundField> </Columns> <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /> <AlternatingRowStyle BackColor="#CCCCCC" /> </asp:GridView> </div> 以下は、使用しているcssファイルの一部です。 .headerstyle_freezing { /*gridviewの表題の枠無しver*/ position: relative; top:expression(this.offsetParent.scrollTop); z-index: 10; } 宜しくお願い致します。 |
1