DetailsView.FooterStyle Właściwość

Definicja

Pobiera odwołanie do TableItemStyle obiektu, który umożliwia ustawienie wyglądu wiersza stopki w kontrolce 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

Wartość właściwości

Odwołanie do TableItemStyle elementu reprezentującego styl wiersza stopki w kontrolce DetailsView .

Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano, jak za pomocą FooterStyle właściwości określić ustawienia czcionki i stylu dla wiersza stopki.


<%@ 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>

Uwagi

Wiersz stopki jest wyświetlany w dolnej części kontrolki DetailsView po ustawieniu FooterText właściwości lub FooterTemplate . FooterStyle Użyj właściwości , aby kontrolować wygląd wiersza stopki w kontrolceDetailsView. Ta właściwość jest tylko do odczytu; można jednak ustawić właściwości zwracanego TableItemStyle obiektu. Właściwości można ustawić deklaratywnie w postaci Property-Subproperty, gdzie Subproperty jest właściwością TableItemStyle obiektu (na przykład FooterStyle-ForeColor). Właściwości można również ustawić programowo w formularzu Property.Subproperty (na przykład FooterStyle.ForeColor). Typowe ustawienia zwykle obejmują niestandardowy kolor tła, kolor pierwszego planu i właściwości czcionki.

Dotyczy

Zobacz też