私は心の友人からこの現在の実装を持っています。プロジェクトには、以下に示すように GridView があります。
<div ID="divGrid" runat="server">
<asp:GridView ID="docGrid" runat="server" AutoGenerateColumns="False" GridLines="None"
DataSourceID="pagedDatasetSourceControl" OnRowDataBound="docGrid_RowDataBound" OnSelectedIndexChanging="docGrid_SelectedIndexChanging" DataKeyNames="ID"
CssClass="gridTable" AllowSorting="True" AllowPaging="True" meta:resourcekey="docGridResource1">
<PagerSettings Visible="false"></PagerSettings>
<Columns>
..................
</Columns>
<RowStyle CssClass="tableRow"></RowStyle>
<PagerStyle VerticalAlign="Bottom" HorizontalAlign="Right"></PagerStyle>
<AlternatingRowStyle CssClass="tableRowAlt"></AlternatingRowStyle>
</asp:GridView>
</div>
この GridView を使用する複数の .cs クラスでは、それぞれの実装が異なります。次に、.cs クラスの「ONE」は、以下に示す「スクロール」を実装します。
this.divGrid.Attributes.Add("class", "fleft scroll");
this.divGrid.Attributes.Add("style", "width:100%; height:250px;");
ただし、上記のコードはヘッダーもスクロールするため、下にスクロールするとヘッダーもスクロールします。このクラスの .cs ファイルに「属性」を追加して、この問題を解決する方法はありますか。
ありがとう