GridView.FooterStyle Propriedade

Definição

Obtém uma referência ao objeto TableItemStyle que permite definir a aparência da linha do rodapé em um controle GridView.Gets a reference to the TableItemStyle object that enables you to set the appearance of the footer row in a GridView control.

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

Valor da propriedade

TableItemStyle

Uma referência ao TableItemStyle que representa o estilo da linha do rodapé em um controle GridView.A reference to the TableItemStyle that represents the style of the footer row in a GridView control.

Atributos

Exemplos

O exemplo a seguir demonstra como usar a FooterStyle propriedade para definir um estilo personalizado para a linha de rodapé em um GridView controle.The following example demonstrates how to use the FooterStyle property to define a custom style for the footer row in a GridView control.


<%@ 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>GridView ShowHeader and ShowFooter Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridView ShowHeader and ShowFooter Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        showheader="true"
        showfooter="true"
        runat="server">
        
        <headerstyle backcolor="LightCyan"
          forecolor="MediumBlue"/>
                    
        <footerstyle backcolor="LightCyan"
          forecolor="MediumBlue"/>
                                    
      </asp:gridview>
            
      <!-- 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="CustomersSource"
        selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
        runat="server"/>
        
    </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>GridView ShowHeader and ShowFooter Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridView ShowHeader and ShowFooter Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        showheader="true"
        showfooter="true"
        runat="server">
        
        <headerstyle backcolor="LightCyan"
          forecolor="MediumBlue"/>
                    
        <footerstyle backcolor="LightCyan"
          forecolor="MediumBlue"/>
                                    
      </asp:gridview>
            
      <!-- 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="CustomersSource"
        selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
        runat="server"/>
        
    </form>
  </body>
</html>

Comentários

Use a FooterStyle propriedade para controlar a aparência da linha de rodapé em um GridView controle.Use the FooterStyle property to control the appearance of the footer row in a GridView control. Esta propriedade é somente leitura; no entanto, você pode definir as propriedades do TableItemStyle objeto retornado.This property is read-only; however, you can set the properties of the TableItemStyle object it returns. As propriedades podem ser definidas declarativamente usando um dos seguintes métodos:The properties can be set declaratively using one of the following methods:

  • Coloque um atributo na marca de abertura do GridView controle no formulário, em Property-Subproperty que Subproperty é uma propriedade do TableItemStyle objeto (por exemplo, FooterStyle-ForeColor ).Place an attribute in the opening tag of the GridView control in the form Property-Subproperty, where Subproperty is a property of the TableItemStyle object (for example, FooterStyle-ForeColor).

  • Aninhe um <FooterStyle> elemento entre as marcas de abertura e de fechamento do GridView controle.Nest a <FooterStyle> element between the opening and closing tags of the GridView control.

As propriedades também podem ser definidas programaticamente no formulário Property.Subproperty (por exemplo, FooterStyle.ForeColor ).The properties can also be set programmatically in the form Property.Subproperty (for example, FooterStyle.ForeColor). As configurações comuns geralmente incluem uma cor de fundo personalizada, cor de primeiro plano e propriedades de fonte.Common settings usually include a custom background color, foreground color, and font properties.

Aplica-se a

Confira também