GridLines GridLines GridLines GridLines Enum

定義

テーブル構造で項目を表示するコントロールのグリッド線のスタイルを指定します。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
継承

フィールド

Both Both Both Both 3

水平グリッド線と垂直グリッド線の両方が表示されます。Both horizontal and vertical gridlines are rendered.

Horizontal Horizontal Horizontal Horizontal 1

水平グリッド線だけが表示されます。Only horizontal gridlines are rendered.

None None None None 0

グリッド線は表示されません。No gridlines are rendered.

Vertical Vertical Vertical Vertical 2

垂直グリッド線だけが表示されます。Only vertical gridlines are rendered.

次のコード例は、 GridLines列挙体を使用して、 GridViewコントロールのグリッド線を非表示にする方法を示しています。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>

注釈

列挙GridLines体は、テーブル構造内の項目を表示するコントロールのさまざまなグリッド線スタイルを表します。The GridLines enumeration represents the different gridline styles for controls that display items in a table structure. 水平方向、垂直方向、水平方向、垂直方向、またはグリッド線なしを表示できます。You can display the horizontal, the vertical, both the horizontal and vertical, or no grid lines.

適用対象

こちらもご覧ください