GridLines 枚举

为在表格结构中显示项的控件指定网格线样式。

**命名空间:**System.Web.UI.WebControls
**程序集:**System.Web(在 system.web.dll 中)

语法

声明
Public Enumeration GridLines
用法
Dim instance As GridLines
public enum GridLines
public enum class GridLines
public enum GridLines
public enum GridLines

成员

  成员名称 说明
Both 同时呈现水平和垂直网格线。 
Horizontal 仅呈现水平网格线。 
None 不呈现网格线。 
Vertical 仅呈现垂直网格线。 

备注

GridLines 枚举表示在表结构中显示项的控件的各种网格线样式。可以显示水平网格线、垂直网格线、同时显示水平和垂直网格线或不显示任何网格线。

示例

下面的代码示例演示如何使用 GridLines 枚举来指示应隐藏 GridView 控件中的网格线。

<%@ Page language="VB" %>

<html>
  <body>
    <form 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="C#" %>

<html>
  <body>
    <form 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>

平台

Windows 98、Windows 2000 SP4、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

System.Web.UI.WebControls 命名空间
BaseDataList 类
BaseDataList.GridLines 属性
DataList 类
DataList.GridLines 属性
DetailsView 类
DetailsView.GridLines 属性
FormView 类
FormView.GridLines 属性
GridView
GridView.GridLines
Table
Table.GridLines
TableStyle
TableStyle.GridLines