DetailsView.FooterStyle プロパティ

定義

TableItemStyle コントロールのフッター行の外観を設定できる DetailsView オブジェクトへの参照を取得します。

public:
 property System::Web::UI::WebControls::TableItemStyle ^ FooterStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.TableItemStyle FooterStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.FooterStyle : System.Web.UI.WebControls.TableItemStyle
Public ReadOnly Property FooterStyle As TableItemStyle

プロパティ値

TableItemStyle コントロールのフッター行のスタイルを表す DetailsView への参照。

属性

次のコード例では、 プロパティを FooterStyle 使用してフッター行のフォントとスタイルの設定を指定する方法を示します。


<%@ Page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>DetailsView FooterText Example</title>
</head>
<body>
    <form id="Form1" runat="server">
        
      <h3>DetailsView FooterText Example</h3>
                
        <asp:detailsview id="CustomerDetailView"
          datasourceid="DetailsViewSource"
          datakeynames="CustomerID"
          autogeneraterows="true"
          allowpaging="true"
          footertext="Confidential"   
          runat="server">
               
          <headerstyle backcolor="Navy"
            forecolor="White"/>
            
          <footerstyle forecolor="Red"
            backcolor="LightBlue" 
            font-names="Arial"
            font-size="10"
            font-bold="true"/>
                    
        </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="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>DetailsView FooterText Example</title>
</head>
<body>
    <form id="Form1" runat="server">
        
      <h3>DetailsView FooterText Example</h3>
                
        <asp:detailsview id="CustomerDetailView"
          datasourceid="DetailsViewSource"
          datakeynames="CustomerID"
          autogeneraterows="true"
          allowpaging="true"
          footertext="Confidential"   
          runat="server">
               
          <headerstyle backcolor="Navy"
            forecolor="White"/>
            
          <footerstyle forecolor="Red"
            backcolor="LightBlue" 
            font-names="Arial"
            font-size="10"
            font-bold="true"/>
                    
        </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>

注釈

または FooterTemplate プロパティが設定されると、フッター行がコントロールのDetailsView下部にFooterText表示されます。 プロパティを FooterStyle 使用して、コントロール内のフッター行の外観を DetailsView 制御します。 このプロパティは読み取り専用です。ただし、返されるオブジェクトのプロパティを TableItemStyle 設定できます。 プロパティは、 という形式 Property-Subpropertyで宣言によって設定できます。ここで Subproperty 、 は オブジェクトの TableItemStyle プロパティ (例: FooterStyle-ForeColor) です。 プロパティは、 形式 Property.Subproperty でプログラムで設定することもできます (例: FooterStyle.ForeColor)。 一般的な設定には、通常、ユーザー設定の背景色、前景色、フォント プロパティが含まれます。

適用対象

こちらもご覧ください