GridLines Wyliczenie

Definicja

Określa style linii siatki dla kontrolek, które wyświetlają elementy w strukturze tabeli.

public enum class GridLines
public enum GridLines
type GridLines = 
Public Enum GridLines
Dziedziczenie
GridLines

Pola

Both 3

Linie siatki poziomej i pionowej są renderowane.

Horizontal 1

Renderowane są tylko poziome linie siatki.

None 0

Linie siatki nie są renderowane.

Vertical 2

Renderowane są tylko pionowe linie siatki.

Przykłady

Poniższy przykład kodu pokazuje, jak za pomocą wyliczenia GridLines wskazać, że linie siatki w kontrolce GridView powinny być ukryte.


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

Uwagi

Wyliczenie GridLines reprezentuje różne style linii siatki dla kontrolek, które wyświetlają elementy w strukturze tabeli. Można wyświetlić poziome, pionowe, zarówno poziome, jak i pionowe, lub bez linii siatki.

Dotyczy

Zobacz też