DetailsView.EditRowStyle プロパティ
アセンブリ: System.Web (system.web.dll 内)

DetailsView コントロールが編集モードの場合のデータ行のスタイルを表す TableItemStyle への参照。

EditRowStyle プロパティを使用して、DetailsView コントロールが編集モードの場合のデータ行の外観を制御します。このプロパティは読み取り専用です。ただし、このプロパティが返す TableItemStyle オブジェクトのプロパティを設定することはできます。このプロパティは、Property-Subproperty の形式で、宣言によって設定できます。Subproperty には、TableItemStyle オブジェクトのプロパティを指定します (例 : EditRowStyle-ForeColor)。Property.Subproperty の形式で、プロパティをプログラムによって設定することもできます (例 : EditRowStyle.ForeColor)。通常、共通設定には、カスタムの背景色、前景色、およびフォントのプロパティが含まれます。

EditRowStyle プロパティを使用して、DetailsView コントロールが編集モードの場合のデータ行のフォントおよびスタイルの設定を指定する方法のコード例を次に示します。
<%@ Page language="VB" %> <html> <body> <form id="Form1" runat="server"> <h3>DetailsView EditRowStyle Example</h3> <asp:detailsview id="CustomerDetailView" datasourceid="DetailsViewSource" datakeynames="CustomerID" autogenerateeditbutton="true" autogeneraterows="true" allowpaging="true" runat="server"> <headerstyle backcolor="Navy" forecolor="White"/> <editrowstyle backcolor="LightCyan" forecolor="Blue" font-names="Arial" /> </asp:detailsview> <!-- This example uses Microsoft SQL Server and connects --> <!-- to the Northwind sample database. Use an ASP.NET --> <!-- expression to retrieve the connection string value --> <!-- from the web.config file. --> <asp:SqlDataSource ID="DetailsViewSource" runat="server" ConnectionString= "<%$ ConnectionStrings:NorthWindConnectionString%>" InsertCommand="INSERT INTO [Customers]([CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country]) VALUES (@CustomerID, @CompanyName, @Address, @City, @PostalCode, @Country)" SelectCommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"> </asp:SqlDataSource> </form> </body> </html>
<%@ Page language="C#" %> <html> <body> <form id="Form1" runat="server"> <h3>DetailsView EditRowStyle Example</h3> <asp:detailsview id="CustomerDetailView" datasourceid="DetailsViewSource" datakeynames="CustomerID" autogenerateeditbutton="true" autogeneraterows="true" allowpaging="true" runat="server"> <headerstyle backcolor="Navy" forecolor="White"/> <editrowstyle backcolor="LightCyan" forecolor="Blue" font-names="Arial" /> </asp:detailsview> <!-- This example uses Microsoft SQL Server and connects --> <!-- to the Northwind sample database. Use an ASP.NET --> <!-- expression to retrieve the connection string value --> <!-- from the web.config file. --> <asp:SqlDataSource ID="DetailsViewSource" runat="server" ConnectionString= "<%$ ConnectionStrings:NorthWindConnectionString%>" InsertCommand="INSERT INTO [Customers]([CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country]) VALUES (@CustomerID, @CompanyName, @Address, @City, @PostalCode, @Country)" SelectCommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"> </asp:SqlDataSource> </form> </body> </html>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からDetailsView.EditRowStyle プロパティを検索する場合は、下記のリンクをクリックしてください。

- DetailsView.EditRowStyle プロパティのページへのリンク