GridLines Enumeração
Definição
Especifica os estilos de linha de grade para controles que exibem itens em uma estrutura de tabela.Specifies the gridline styles for controls that display items in a table structure.
public enum class GridLines
public enum GridLines
type GridLines =
Public Enum GridLines
- Herança
Campos
| Both | 3 | Linhas de grade horizontais e verticais são renderizadas.Both horizontal and vertical gridlines are rendered. |
| Horizontal | 1 | Apenas linhas de grade horizontais são renderizadas.Only horizontal gridlines are rendered. |
| None | 0 | Nenhuma linha de grade é renderizada.No gridlines are rendered. |
| Vertical | 2 | Apenas linhas de grade verticais são renderizadas.Only vertical gridlines are rendered. |
Exemplos
O exemplo de código a seguir demonstra como usar a GridLines enumeração para indicar que as linhas de grade em um GridView controle devem ser ocultadas.The following code example demonstrates how to use the GridLines enumeration to indicate that the gridlines in a GridView control should be hidden.
<%@ 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 GridLines Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>GridView GridLines Example</h3>
<asp:gridview id="CustomersGridView"
datasourceid="CustomersSqlDataSource"
autogeneratecolumns="true"
gridlines="None"
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="CustomersSqlDataSource"
selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
runat="server">
</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>GridView GridLines Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>GridView GridLines Example</h3>
<asp:gridview id="CustomersGridView"
datasourceid="CustomersSqlDataSource"
autogeneratecolumns="true"
gridlines="None"
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="CustomersSqlDataSource"
selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
runat="server">
</asp:sqldatasource>
</form>
</body>
</html>
Comentários
A GridLines enumeração representa os diferentes estilos de linha de grade para controles que exibem itens em uma estrutura de tabela.The GridLines enumeration represents the different gridline styles for controls that display items in a table structure. Você pode exibir as linhas horizontal, vertical, horizontal e vertical ou nenhuma grade.You can display the horizontal, the vertical, both the horizontal and vertical, or no grid lines.