GridView.BackImageUrl Propriedade
Definição
public:
virtual property System::String ^ BackImageUrl { System::String ^ get(); void set(System::String ^ value); };
public virtual string BackImageUrl { get; set; }
member this.BackImageUrl : string with get, set
Public Overridable Property BackImageUrl As String
Valor da propriedade
A URL de uma imagem a ser exibida na tela de fundo do controle GridView.The URL of an image to display in the background of the GridView control. O padrão é uma cadeia de caracteres vazia (""), que indica que essa propriedade não está definida.The default is an empty string (""), which indicates that this property is not set.
Exemplos
O exemplo a seguir demonstra como usar a BackImageUrl propriedade para exibir uma imagem personalizada no plano de fundo de um GridView controle.The following example demonstrates how to use the BackImageUrl property to display a custom image in the background of 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 BackImageUrl Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>GridView BackImageUrl Example</h3>
<asp:gridview id="CustomersGridView"
datasourceid="CustomersSource"
autogeneratecolumns="true"
emptydatatext="No data available."
backimageurl="~/images/logo.jpg"
runat="server">
</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 BackImageUrl Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>GridView BackImageUrl Example</h3>
<asp:gridview id="CustomersGridView"
datasourceid="CustomersSource"
autogeneratecolumns="true"
emptydatatext="No data available."
backimageurl="~/images/logo.jpg"
runat="server">
</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 BackImageUrl propriedade para especificar a URL para uma imagem a ser exibida no plano de fundo de um GridView controle.Use the BackImageUrl property to specify the URL to an image to display in the background of a GridView control.
Observação
Se a imagem especificada for menor do que o GridView controle, a imagem será colocada lado a lado para preencher o plano de fundo.If the specified image is smaller than the GridView control, the image is tiled to fill in the background. Se a imagem for maior que o controle, a imagem será cortada.If the image is larger than the control, the image is cropped.