DetailsView.FooterStyle Proprietà

Definizione

Ottiene un riferimento all'oggetto TableItemStyle che consente di impostare l'aspetto della riga del piè di pagina in un controllo 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

Valore della proprietà

Un riferimento all'oggetto TableItemStyle che rappresenta lo stile della riga del piè di pagina in un controllo DetailsView.

Attributi

Esempio

Nell'esempio di codice seguente viene illustrato come usare la FooterStyle proprietà per specificare le impostazioni del carattere e dello stile per la riga piè di pagina.


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

Commenti

La riga piè di pagina viene visualizzata nella parte inferiore del DetailsView controllo quando la FooterText proprietà o FooterTemplate è impostata. Utilizzare la FooterStyle proprietà per controllare l'aspetto della riga piè di pagina in un DetailsView controllo. Questa proprietà è di sola lettura; tuttavia, è possibile impostare le proprietà dell'oggetto TableItemStyle restituito. Le proprietà possono essere impostate in modo dichiarativo nel formato Property-Subproperty, dove Subproperty è una proprietà dell'oggetto TableItemStyle , ad esempio FooterStyle-ForeColor. Le proprietà possono anche essere impostate a livello di codice nel modulo Property.Subproperty ( ad esempio , FooterStyle.ForeColor). Le impostazioni comuni in genere includono un colore di sfondo personalizzato, il colore di primo piano e le proprietà del carattere.

Si applica a

Vedi anche