Obtiene un objeto
GridViewRow que representa la fila de pie de página de un control
GridView.
Espacio de nombres: System.Web.UI.WebControls
Ensamblado: System.Web (en system.web.dll)
Public Overridable ReadOnly Property FooterRow As GridViewRow
Dim instance As GridView
Dim value As GridViewRow
value = instance.FooterRow
El código de ejemplo para este idioma aún no está disponible.
/** @property */
public GridViewRow get_FooterRow ()
Valor de propiedad
Objeto GridViewRow que representa la fila de pie de página de un control GridView.
Utilice la propiedad FooterRow para tener acceso mediante programación al objeto GridViewRow que representa la fila de pie de página de un control GridView.
Nota: |
|---|
| La propiedad FooterRow sólo está disponible después de que el control GridView crea la fila de pie de página en el evento RowCreated. |
Normalmente se utiliza esta propiedad cuando es necesario manipular la fila de pie de página mediante programación, por ejemplo, al agregar contenido personalizado. Cualquier modificación de la propiedad FooterRow debe realizarse después de que se haya representado el control GridView; de lo contrario, el control GridView sobrescribirá los cambios.
En el ejemplo de código siguiente se muestra cómo utilizar la propiedad FooterRow para mostrar el sentido de ordenación de la fila de pie de página.
<%@ Page language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Sub CustomersGridView_DataBound(ByVal sender As Object, ByVal e As EventArgs)
' Get the header row.
Dim headerRow As GridViewRow = CustomersGridView.HeaderRow
' Get the footer row.
Dim footerRow As GridViewRow = CustomersGridView.FooterRow
' Set the font color of the header and footer rows
' based on the sort direction.
Select Case CustomersGridView.SortDirection
Case SortDirection.Ascending
headerRow.ForeColor = System.Drawing.Color.Green
footerRow.ForeColor = System.Drawing.Color.Green
Case SortDirection.Descending
headerRow.ForeColor = System.Drawing.Color.Red
footerRow.ForeColor = System.Drawing.Color.Red
Case Else
headerRow.ForeColor = System.Drawing.Color.Black
footerRow.ForeColor = System.Drawing.Color.Black
End Select
' Display the sort order in the footer row.
footerRow.Cells(0).Text = "Sort Order = " & CustomersGridView.SortDirection.ToString()
End Sub
</script>
<html >
<head runat="server">
<title>GridView HeaderRow and FooterRow Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>GridView HeaderRow and FooterRow Example</h3>
<asp:gridview id="CustomersGridView"
datasourceid="CustomersSource"
autogeneratecolumns="true"
emptydatatext="No data available."
allowsorting="true"
allowpaging="true"
showheader="true"
showfooter="true"
ondatabound="CustomersGridView_DataBound"
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>
Windows 98, Windows 2000 Service Pack 4, Windows CE, Windows Millennium, Windows Mobile para Pocket PC, Windows Mobile para Smartphone, Windows Server 2003, Windows XP Media Center, Windows XP Professional x64, Windows XP SP2, Windows XP Starter
Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.
.NET Framework
Compatible con: 3.0, 2.0