GridViewRow クラス

定義

GridView コントロール内の個別の行を表します。

public ref class GridViewRow : System::Web::UI::WebControls::TableRow, System::Web::UI::IDataItemContainer
public class GridViewRow : System.Web.UI.WebControls.TableRow, System.Web.UI.IDataItemContainer
type GridViewRow = class
    inherit TableRow
    interface IDataItemContainer
    interface INamingContainer
Public Class GridViewRow
Inherits TableRow
Implements IDataItemContainer
継承
実装

次の例では、 オブジェクトを GridViewRow 使用してコントロール内 GridView のセルからフィールド値を取得し、その値をページに表示する方法を示します。


<%@ Page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  void AuthorsGridView_SelectedIndexChanged(Object sender, EventArgs e)
  {
  
    // Get the selected row from the GridView control.
    GridViewRow selectRow = AuthorsGridView.SelectedRow;
    
    // Get the author's first and last name from the appropriate
    // cells in the selected row. For BoundField field columns
    // and automatically generated field columns, the Text property
    // of a cell is used to access a field value.
    String lastName = selectRow.Cells[1].Text;
    
    // In a TemplateField column where a data-binding expression
    // is used directly in the ItemTemplate, the field value
    // is automatically placed in DataBoundLiteral control.
    
    // Retrieve the DataBoundLiteral control from the cell. The
    // DataBoundLiteral control is the first control in the 
    // Controls collection.
    DataBoundLiteralControl firstNameLiteral = (DataBoundLiteralControl)selectRow.Cells[2].Controls[0];
    String firstName = firstNameLiteral.Text;
    
    // Display the name of the selected author.
    Message.Text = "You selected " + firstName + " " + lastName + ".";
    
  }

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>GridViewRow Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridViewRow Example</h3>

      <asp:label id="Message" 
        forecolor="Red"
        runat="server"/>
              
      <br/> 

      <asp:gridview id="AuthorsGridView" 
        datasourceid="AuthorsSqlDataSource" 
        autogeneratecolumns="false"
        autogenerateselectbutton="true"
        onselectedindexchanged="AuthorsGridView_SelectedIndexChanged"  
        runat="server"> 
               
        <columns>
          <asp:boundfield datafield="au_lname"
            headertext="Last Name"/>
          <asp:templatefield headertext="FirstName">
            <itemtemplate>
              <%#Eval("au_fname")%>
            </itemtemplate>
          </asp:templatefield>
        </columns>
                              
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects -->
      <!-- to the Pubs sample database.                        -->
      <asp:sqldatasource id="AuthorsSqlDataSource"  
        selectcommand="SELECT [au_lname], [au_fname], [address], [city], [state], [zip], [contract] FROM [authors]"
        connectionstring="server=localhost;database=pubs;integrated security=SSPI"
        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">
<script runat="server">

  Sub AuthorsGridView_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
    
    ' Get the selected row from the GridView control.
    Dim selectRow As GridViewRow = AuthorsGridView.SelectedRow
    
    ' Get the author's first and last name from the appropriate
    ' cells in the selected row. For BoundField field columns
    ' and automatically generated field columns, the Text property
    ' of a cell is used to access a field value.
    Dim lastName As String = selectRow.Cells(1).Text
    
    ' In a TemplateField column where a data-binding expression
    ' is used directly in the ItemTemplate, the field value
    ' is automatically placed in DataBoundLiteral control.
    
    ' Retrieve the DataBoundLiteral control from the cell. The
    ' DataBoundLiteral control is the first control in the 
    ' Controls collection.
    Dim firstNameLiteral As DataBoundLiteralControl = CType(selectRow.Cells(2).Controls(0), DataBoundLiteralControl)
    Dim firstName As String = firstNameLiteral.Text
    
    ' Display the name of the selected author.
    Message.Text = "You selected " & firstName & " " & lastName & "."
    
  End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>GridViewRow Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridViewRow Example</h3>

      <asp:label id="Message" 
        forecolor="Red"
        runat="server"/>
              
      <br/> 

      <asp:gridview id="AuthorsGridView" 
        datasourceid="AuthorsSqlDataSource" 
        autogeneratecolumns="false"
        autogenerateselectbutton="true"
        onselectedindexchanged="AuthorsGridView_SelectedIndexChanged"  
        runat="server"> 
               
        <columns>
          <asp:boundfield datafield="au_lname"
            headertext="Last Name"/>
          <asp:templatefield headertext="FirstName">
            <itemtemplate>
              <%#Eval("au_fname")%>
            </itemtemplate>
          </asp:templatefield>
        </columns>
                              
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects -->
      <!-- to the Pubs sample database.                        -->
      <asp:sqldatasource id="AuthorsSqlDataSource"  
        selectcommand="SELECT [au_lname], [au_fname], [address], [city], [state], [zip], [contract] FROM [authors]"
        connectionstring="server=localhost;database=pubs;integrated security=SSPI"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

次の例では、 オブジェクトをGridViewRow使用して、フィールド列の編集項目テンプレートで宣言されたコントロールをTemplateField取得TextBoxする方法を示します。 テキスト ボックスの値は、データ ソースで SqlDataSource 更新するためにコントロールに渡されます。

重要

この例には、ユーザー入力を受け付けるテキスト ボックスがあります。これにより、セキュリティが脆弱になる可能性があります。 既定では、ASP.NET Web ページによって、ユーザー入力にスクリプトまたは HTML 要素が含まれていないかどうかが検証されます。 詳細については、「スクリプトによる攻略の概要」を参照してください。

<%@ Page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
  
  void AuthorsGridView_RowUpdating (Object sender, GridViewUpdateEventArgs e)
  {
    
    // In this example, the GridView control will not automatically extract 
    // updated values from TemplateField column fields because they are not
    // using a two-way binding expression. So, the updated
    // values must be added manually to the NewValues dictionary.
    
    // Get the GridViewRow object that represents the row being edited
    // from the Rows collection of the GridView control.
    int index = AuthorsGridView.EditIndex;
    GridViewRow row = AuthorsGridView.Rows[index];
    
    // Get the controls that contain the updated values. In this
    // example, the updated values are contained in the TextBox 
    // controls declared in the EditItemTemplates of the TemplateField 
    // column fields in the GridView control.
    TextBox lastName = (TextBox)row.FindControl("LastNameTextBox");
    TextBox firstName = (TextBox)row.FindControl("FirstNameTextBox");
    
    // Add the updated values to the NewValues dictionary. Use the
    // parameter names declared in the parameterized update query 
    // string for the key names.
    e.NewValues["au_lname"] = lastName.Text;
    e.NewValues["au_fname"] = firstName.Text;    
          
  }

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>GridViewRow Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridViewRow Example</h3>

      <!-- The GridView control automatically sets the columns     -->
      <!-- specified in the datakeynames attribute as read-only    -->
      <!-- No input controls are rendered for these columns in     -->
      <!-- edit mode.                                              -->
      <asp:gridview id="AuthorsGridView" 
        datasourceid="AuthorsSqlDataSource" 
        autogeneratecolumns="false"
        autogenerateeditbutton="true"
        datakeynames="au_id"
        cellpadding="10"
        onrowupdating="AuthorsGridView_RowUpdating"      
        runat="server">
                
        <columns>
        
          <asp:boundfield datafield="au_id"
            headertext="Author ID"
            readonly="true"/>
            
          <asp:templatefield headertext="Last Name"
            itemstyle-verticalalign="Top">
            
            <itemtemplate>
              <%#Eval("au_lname")%>
            </itemtemplate>
            
            <edititemtemplate>
              <asp:textbox id="LastNameTextBox"
                text='<%#Eval("au_lname")%>'
                width="90"
                runat="server"/>
              <br/>
              <asp:requiredfieldvalidator id="LastNameRequiredValidator"
                controltovalidate="LastNameTextBox"
                display="Dynamic"
                text="Please enter a last name." 
                runat="server" />                                      
            </edititemtemplate>
            
          </asp:templatefield>
          
          <asp:templatefield headertext="First Name"
            itemstyle-verticalalign="Top">
            
            <itemtemplate>
              <%#Eval("au_fname")%>
            </itemtemplate>
            
            <edititemtemplate>
              <asp:textbox id="FirstNameTextBox"
                text='<%#Eval("au_fname")%>'
                width="90"
                runat="server"/>
              <br/>
              <asp:requiredfieldvalidator id="FirstNameRequiredValidator"
                controltovalidate="FirstNameTextBox"
                display="Dynamic"
                text="Please enter a first name."
                runat="server" />                      
            </edititemtemplate>
            
          </asp:templatefield>
          
          <asp:checkboxfield datafield="contract" 
            headertext="Contract"
            readonly="true"/>
            
        </columns>
                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects -->
      <!-- to the Pubs sample database.                        -->
      <asp:sqldatasource id="AuthorsSqlDataSource"  
        selectcommand="SELECT [au_id], [au_lname], [au_fname], [contract] FROM [authors]"             
        updatecommand="UPDATE authors SET au_lname=@au_lname, au_fname=@au_fname WHERE (authors.au_id = @au_id)" 
        connectionstring="server=localhost;database=pubs;integrated security=SSPI"
        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">
<script runat="server">
  
  Sub AuthorsGridView_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs)
    
    ' In this example, the GridView control will not automatically extract 
    ' updated values from TemplateField column fields because they are not
    ' using a two-way binding expression. So, the updated
    ' values must be added manually to the NewValues dictionary.
    
    ' Get the GridViewRow object that represents the row being edited
    ' from the Rows collection of the GridView control.
    Dim index As Integer = AuthorsGridView.EditIndex
    Dim row As GridViewRow = AuthorsGridView.Rows(index)
    
    ' Get the controls that contain the updated values. In this
    ' example, the updated values are contained in the TextBox 
    ' controls declared in the EditItemTemplates of the TemplateField 
    ' column fields in the GridView control.
    Dim lastName As TextBox = CType(row.FindControl("LastNameTextBox"), TextBox)
    Dim firstName As TextBox = CType(row.FindControl("FirstNameTextBox"), TextBox)
    
    ' Add the updated values to the NewValues dictionary. Use the
    ' parameter names declared in the parameterized update query 
    ' string for the key names.
    e.NewValues("au_lname") = lastName.Text
    e.NewValues("au_fname") = firstName.Text
          
  End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>GridViewRow Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridViewRow Example</h3>

      <!-- The GridView control automatically sets the columns     -->
      <!-- specified in the datakeynames attribute as read-only    -->
      <!-- No input controls are rendered for these columns in     -->
      <!-- edit mode.                                              -->
      <asp:gridview id="AuthorsGridView" 
        datasourceid="AuthorsSqlDataSource" 
        autogeneratecolumns="false"
        autogenerateeditbutton="true"
        datakeynames="au_id"
        cellpadding="10"
        onrowupdating="AuthorsGridView_RowUpdating"      
        runat="server">
                
        <columns>
        
          <asp:boundfield datafield="au_id"
            headertext="Author ID"
            readonly="true"/>
            
          <asp:templatefield headertext="Last Name"
            itemstyle-verticalalign="Top">
            
            <itemtemplate>
              <%#Eval("au_lname")%>
            </itemtemplate>
            
            <edititemtemplate>
              <asp:textbox id="LastNameTextBox"
                text='<%#Eval("au_lname")%>'
                width="90"
                runat="server"/>
              <br/>
              <asp:requiredfieldvalidator id="LastNameRequiredValidator"
                controltovalidate="LastNameTextBox"
                display="Dynamic"
                text="Please enter a last name." 
                runat="server" />                                      
            </edititemtemplate>
            
          </asp:templatefield>
          
          <asp:templatefield headertext="First Name"
            itemstyle-verticalalign="Top">
            
            <itemtemplate>
              <%#Eval("au_fname")%>
            </itemtemplate>
            
            <edititemtemplate>
              <asp:textbox id="FirstNameTextBox"
                text='<%#Eval("au_fname")%>'
                width="90"
                runat="server"/>
              <br/>
              <asp:requiredfieldvalidator id="FirstNameRequiredValidator"
                controltovalidate="FirstNameTextBox"
                display="Dynamic"
                text="Please enter a first name."
                runat="server" />                      
            </edititemtemplate>
            
          </asp:templatefield>
          
          <asp:checkboxfield datafield="contract" 
            headertext="Contract"
            readonly="true"/>
            
        </columns>
                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects -->
      <!-- to the Pubs sample database.                         -->
      <asp:sqldatasource id="AuthorsSqlDataSource"  
        selectcommand="SELECT [au_id], [au_lname], [au_fname], [contract] FROM [authors]"             
        updatecommand="UPDATE authors SET au_lname=@au_lname, au_fname=@au_fname WHERE (authors.au_id = @au_id)" 
        connectionstring="server=localhost;database=pubs;integrated security=SSPI"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

注釈

クラスは GridViewRow 、コントロール内の個々の行を GridView 表します。 コントロール内の GridView 各行には、 列挙を使用して指定された行の種類があります DataControlRowType 。 次の表に、さまざまな行の種類を示します。

行の種類 [説明]
DataRow コントロールの GridView データ行。
EmptyDataRow コントロール内の空の GridView 行。 コントロールに表示するレコードがなく、テンプレートが でないnull場合GridView、空のGridView.EmptyDataTemplate行が表示されます。
Footer コントロールの GridView フッター行。
Header コントロールの GridView ヘッダー行。
Pager コントロール内の GridView ポケットベル行。
Separator コントロールの GridView 区切り線。

オブジェクトの行の種類を GridViewRow 確認するには、 プロパティを RowType 使用します。 GridViewRowオブジェクトには、関連付けられた状態もあります。 状態は、次の表の値のビットごとの組み合わせにすることができます。

状態の値 説明
Alternate オブジェクトは GridViewRow 、コントロール内の代替行です GridView
Edit オブジェクトは GridViewRow 編集モードです。
Normal オブジェクトは GridViewRow 通常 (既定値) の状態です。
Selected GridViewRowオブジェクトが選択されています。

オブジェクトの GridViewRow 状態を確認するには、 プロパティを RowState 使用します。

コントロールは GridView 、コレクション内のすべてのデータ行を Rows 格納します。 コレクション内RowsのオブジェクトのインデックスをGridViewRow確認するには、 プロパティをRowIndex使用します。

プロパティを使用して、オブジェクトにバインドされている基になるデータ オブジェクトの GridViewRow プロパティに DataItem アクセスできます。

Note

プロパティはDataItem、コントロールのイベント中およびイベントGridViewRowDataBoundにのみ使用できます。

基になるデータ ソース内のデータ オブジェクトのインデックスを確認するには、 プロパティを DataItemIndex 使用します。

プロパティを使用して、オブジェクトの個々の GridViewRow セルに Cells アクセスできます。 セルに他のコントロールが含まれている場合は、セルのコレクションを使用 Controls して、セルからコントロールを取得できます。 コントロールに が FindControl 指定されている場合は、セルの メソッドを使用してコントロールを ID 検索することもできます。

フィールド列または自動的に生成されたフィールド列から BoundField フィールド値を取得するには、セルの プロパティを使用 Text します。 フィールド値がコントロールにバインドされている他のフィールド列型からフィールド値を取得するには、まず適切なセルからコントロールを取得してから、コントロールの適切なプロパティにアクセスします。

Note

値をコントロールの プロパティにバインドせずに、 TemplateField フィールド列でデータ バインディング式を直接使用できます。 この場合、フィールド値はコントロールに自動的に DataBoundLiteralControl 配置されます。 フィールド値を取得するには、まず適切なセルからコントロールを DataBoundLiteralControl 取得してから、そのプロパティを Text 使用する必要があります。

のインスタンスの初期プロパティ値の GridViewRow一覧については、 コンストラクターを GridViewRow 参照してください。

コンストラクター

GridViewRow(Int32, Int32, DataControlRowType, DataControlRowState)

GridViewRow クラスの新しいインスタンスを初期化します。

プロパティ

AccessKey

Web サーバー コントロールにすばやく移動できるアクセス キーを取得または設定します。

(継承元 WebControl)
Adapter

コントロール用のブラウザー固有のアダプターを取得します。

(継承元 Control)
AppRelativeTemplateSourceDirectory

このコントロールが含まれている Page オブジェクトまたは UserControl オブジェクトのアプリケーション相対の仮想ディレクトリを取得または設定します。

(継承元 Control)
Attributes

コントロールのプロパティに対応しない任意の属性 (表示専用) のコレクションを取得します。

(継承元 WebControl)
BackColor

Web サーバー コントロールの背景色を取得または設定します。

(継承元 WebControl)
BindingContainer

このコントロールのデータ バインディングを格納しているコントロールを取得します。

(継承元 Control)
BorderColor

Web コントロールの境界線の色を取得または設定します。

(継承元 WebControl)
BorderStyle

Web サーバー コントロールの境界線スタイルを取得または設定します。

(継承元 WebControl)
BorderWidth

Web サーバー コントロールの境界線の幅を取得または設定します。

(継承元 WebControl)
Cells

TableCell コントロールの行のセルを表す Table オブジェクトのコレクションを取得します。

(継承元 TableRow)
ChildControlsCreated

サーバー コントロールの子コントロールが作成されたかどうかを示す値を取得します。

(継承元 Control)
ClientID

ASP.NET によって生成される HTML マークアップのコントロール ID を取得します。

(継承元 Control)
ClientIDMode

ClientID プロパティの値を生成するために使用されるアルゴリズムを取得または設定します。

(継承元 Control)
ClientIDSeparator

ClientID プロパティで使用される区切り記号を表す文字値を取得します。

(継承元 Control)
Context

現在の Web 要求に対するサーバー コントロールに関連付けられている HttpContext オブジェクトを取得します。

(継承元 Control)
Controls

UI 階層内の指定されたサーバー コントロールの子コントロールを表す ControlCollection オブジェクトを取得します。

(継承元 Control)
ControlStyle

Web サーバー コントロールのスタイルを取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
ControlStyleCreated

Style オブジェクトが ControlStyle プロパティに対して作成されたかどうかを示す値を取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
CssClass

クライアントで Web サーバー コントロールによって表示されるカスケード スタイル シート (CSS: Cascading Style Sheet) クラスを取得または設定します。

(継承元 WebControl)
DataItem

GridViewRow オブジェクトのバインド先の基になるデータ オブジェクトを取得します。

DataItemContainer

名前付けコンテナーが IDataItemContainer を実装している場合、名前付けコンテナーへの参照を取得します。

(継承元 Control)
DataItemIndex

基になる DataItem 内での DataSet のインデックスを取得します。

DataKeysContainer

名前付けコンテナーが IDataKeysControl を実装している場合、名前付けコンテナーへの参照を取得します。

(継承元 Control)
DesignMode

コントロールがデザイン サーフェイスで使用されているかどうかを示す値を取得します。

(継承元 Control)
Enabled

Web サーバー コントロールを有効にするかどうかを示す値を取得または設定します。

(継承元 WebControl)
EnableTheming

テーマがこのコントロールに適用されるかどうかを示す値を取得または設定します。

(継承元 WebControl)
EnableViewState

要求元クライアントに対して、サーバー コントロールがそのビュー状態と、そこに含まれる任意の子のコントロールのビュー状態を保持するかどうかを示す値を取得または設定します。

(継承元 Control)
Events

コントロールのイベント ハンドラー デリゲートのリストを取得します。 このプロパティは読み取り専用です。

(継承元 Control)
Font

Web サーバー コントロールに関連付けられたフォント プロパティを取得します。

(継承元 WebControl)
ForeColor

Web サーバー コントロールの前景色 (通常はテキストの色) を取得または設定します。

(継承元 WebControl)
HasAttributes

コントロールに属性セットがあるかどうかを示す値を取得します。

(継承元 WebControl)
HasChildViewState

現在のサーバー コントロールの子コントロールが、保存されたビューステートの設定を持っているかどうかを示す値を取得します。

(継承元 Control)
Height

Web サーバー コントロールの高さを取得または設定します。

(継承元 WebControl)
HorizontalAlign

行の内容の水平方向の配置を取得または設定します。

(継承元 TableRow)
ID

サーバー コントロールに割り当てられたプログラム ID を取得または設定します。

(継承元 Control)
IdSeparator

コントロール ID を区別するために使用する文字を取得します。

(継承元 Control)
IsChildControlStateCleared

このコントロールに含まれているコントロールに、コントロールの状態が設定されているかどうかを示す値を取得します。

(継承元 Control)
IsEnabled

コントロールが有効かどうかを示す値を取得します。

(継承元 WebControl)
IsTrackingViewState

サーバー コントロールがビューステートの変更を保存しているかどうかを示す値を取得します。

(継承元 Control)
IsViewStateEnabled

このコントロールでビューステートが有効かどうかを示す値を取得します。

(継承元 Control)
LoadViewStateByID

コントロールがインデックスではなく ID によりビューステートの読み込みを行うかどうかを示す値を取得します。

(継承元 Control)
NamingContainer

同じ ID プロパティ値を持つ複数のサーバー コントロールを区別するための一意の名前空間を作成する、サーバー コントロールの名前付けコンテナーへの参照を取得します。

(継承元 Control)
Page

サーバー コントロールを含んでいる Page インスタンスへの参照を取得します。

(継承元 Control)
Parent

ページ コントロールの階層構造における、サーバー コントロールの親コントロールへの参照を取得します。

(継承元 Control)
RenderingCompatibility

レンダリングされる HTML と互換性がある ASP.NET のバージョンを表す値を取得します。

(継承元 Control)
RowIndex

of a GridViewRow コントロールの Rows コレクションから GridView オブジェクトのインデックスを取得します。

RowState

GridViewRow オブジェクトの状態を取得します。

RowType

GridViewRow オブジェクトの行の種類を取得します。

Site

デザイン サーフェイスに現在のコントロールを表示するときに、このコントロールをホストするコンテナーに関する情報を取得します。

(継承元 Control)
SkinID

コントロールに適用するスキンを取得または設定します。

(継承元 WebControl)
Style

Web サーバー コントロールの外側のタグにスタイル属性として表示されるテキスト属性のコレクションを取得します。

(継承元 WebControl)
SupportsDisabledAttribute

コントロールの disabled プロパティが IsEnabled の場合、レンダリングされた HTML 要素の false 属性を "無効" に設定するかどうかを示す値を取得します。

(継承元 TableRow)
TabIndex

Web サーバー コントロールのタブ インデックスを取得または設定します。

(継承元 WebControl)
TableSection

TableRow コントロール内の Table オブジェクトの場所を取得または設定します。

(継承元 TableRow)
TagKey

この Web サーバー コントロールに対応する HtmlTextWriterTag 値を取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
TagName

コントロール タグの名前を取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
TemplateControl

このコントロールを格納しているテンプレートへの参照を取得または設定します。

(継承元 Control)
TemplateSourceDirectory

現在のサーバー コントロールを格納している Page または UserControl の仮想ディレクトリを取得します。

(継承元 Control)
ToolTip

マウス ポインターが Web サーバー コントロールの上を移動したときに表示されるテキストを取得または設定します。

(継承元 WebControl)
UniqueID

階層構造で修飾されたサーバー コントロールの一意の ID を取得します。

(継承元 Control)
ValidateRequestMode

ブラウザーからのクライアント入力の安全性をコントロールで調べるかどうかを示す値を取得または設定します。

(継承元 Control)
VerticalAlign

行の内容の垂直方向の配置を取得または設定します。

(継承元 TableRow)
ViewState

同一のページに対する複数の要求にわたって、サーバー コントロールのビューステートを保存し、復元できるようにする状態情報のディクショナリを取得します。

(継承元 Control)
ViewStateIgnoresCase

StateBag オブジェクトが大文字小文字を区別しないかどうかを示す値を取得します。

(継承元 Control)
ViewStateMode

このコントロールのビューステート モードを取得または設定します。

(継承元 Control)
Visible

サーバー コントロールがページ上の UI としてレンダリングされているかどうかを示す値を取得または設定します。

(継承元 Control)
Width

Web サーバー コントロールの幅を取得または設定します。

(継承元 WebControl)

メソッド

AddAttributesToRender(HtmlTextWriter)

指定した HtmlTextWriterTag に表示する必要のある HTML 属性およびスタイルを追加します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
AddedControl(Control, Int32)

子コントロールが Control オブジェクトの Controls コレクションに追加された後に呼び出されます。

(継承元 Control)
AddParsedSubObject(Object)

XML または HTML のいずれかの要素が解析されたことをサーバー コントロールに通知し、サーバー コントロールの ControlCollection オブジェクトに要素を追加します。

(継承元 Control)
ApplyStyle(Style)

指定したスタイルの空白以外の要素を Web コントロールにコピーして、コントロールの既存のスタイル要素を上書きします。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
ApplyStyleSheetSkin(Page)

ページのスタイル シートに定義されたスタイル プロパティをコントロールに適用します。

(継承元 Control)
BeginRenderTracing(TextWriter, Object)

レンダリング データのデザイン時のトレースを開始します。

(継承元 Control)
BuildProfileTree(String, Boolean)

ページのトレースが有効な場合、サーバー コントロールに関する情報を収集し、これを表示するために Trace プロパティに渡します。

(継承元 Control)
ClearCachedClientID()

キャッシュされた ClientID 値を null に設定します。

(継承元 Control)
ClearChildControlState()

サーバー コントロールのすべての子コントロールについて、コントロールの状態情報を削除します。

(継承元 Control)
ClearChildState()

サーバー コントロールのすべての子コントロールのビューステート情報およびコントロールの状態情報を削除します。

(継承元 Control)
ClearChildViewState()

サーバー コントロールのすべての子コントロールのビューステート情報を削除します。

(継承元 Control)
ClearEffectiveClientIDMode()

現在のコントロール インスタンスおよびすべての子コントロールの ClientIDMode プロパティを Inherit に設定します。

(継承元 Control)
CopyBaseAttributes(WebControl)

指定した Web サーバー コントロールから、Style オブジェクトでカプセル化されていないプロパティをこのメソッドの呼び出し元の Web サーバー コントロールにコピーします。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
CreateChildControls()

ASP.NET ページ フレームワークによって呼び出され、ポストバックまたはレンダリングの準備として、合成ベースの実装を使うサーバー コントロールに対し、それらのコントロールに含まれる子コントロールを作成するように通知します。

(継承元 Control)
CreateControlCollection()

ControlCollection コントロールに新しい TableRow オブジェクトを作成します。

(継承元 TableRow)
CreateControlStyle()

TableItemStyle コントロールの TableRow オブジェクトを作成します。

(継承元 TableRow)
DataBind()

呼び出されたサーバー コントロールとそのすべての子コントロールにデータ ソースをバインドします。

(継承元 Control)
DataBind(Boolean)

DataBinding イベントを発生させるオプションを指定して、呼び出されたサーバー コントロールとそのすべての子コントロールにデータ ソースをバインドします。

(継承元 Control)
DataBindChildren()

データ ソースをサーバー コントロールの子コントロールにバインドします。

(継承元 Control)
Dispose()

サーバー コントロールが、メモリから解放される前に最終的なクリーンアップを実行できるようにします。

(継承元 Control)
EndRenderTracing(TextWriter, Object)

レンダリング データのデザイン時のトレースを終了します。

(継承元 Control)
EnsureChildControls()

サーバー コントロールに子コントロールが含まれているかどうかを確認します。 含まれていない場合、子コントロールを作成します。

(継承元 Control)
EnsureID()

ID が割り当てられていないコントロールの ID を作成します。

(継承元 Control)
Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
FindControl(String)

指定した id パラメーターを使用して、サーバー コントロールの現在の名前付けコンテナーを検索します。

(継承元 Control)
FindControl(String, Int32)

指定した id および検索に役立つ pathOffset パラメーターに指定された整数を使用して、サーバー コントロールの現在の名前付けコンテナーを検索します。 この形式の FindControl メソッドはオーバーライドしないでください。

(継承元 Control)
Focus()

コントロールに入力フォーカスを設定します。

(継承元 Control)
GetDesignModeState()

コントロールのデザイン時データを取得します。

(継承元 Control)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetRouteUrl(Object)

ルート パラメーターのセットに対応する URL を取得します。

(継承元 Control)
GetRouteUrl(RouteValueDictionary)

ルート パラメーターのセットに対応する URL を取得します。

(継承元 Control)
GetRouteUrl(String, Object)

ルート パラメーターのセットおよびルート名に対応する URL を取得します。

(継承元 Control)
GetRouteUrl(String, RouteValueDictionary)

ルート パラメーターのセットおよびルート名に対応する URL を取得します。

(継承元 Control)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
GetUniqueIDRelativeTo(Control)

指定されたコントロールの UniqueID プロパティのプレフィックス部分を返します。

(継承元 Control)
HasControls()

サーバー コントロールに子コントロールが含まれているかどうかを確認します。

(継承元 Control)
HasEvents()

コントロールまたは子コントロールに対してイベントが登録されているかどうかを示す値を返します。

(継承元 Control)
IsLiteralContent()

サーバー コントロールがリテラルな内容だけを保持しているかどうかを決定します。

(継承元 Control)
LoadControlState(Object)

SaveControlState() メソッドによって保存された前回のページ要求からコントロールの状態情報を復元します。

(継承元 Control)
LoadViewState(Object)

SaveViewState() メソッドで保存された前の要求からビュー ステート情報を復元します。

(継承元 WebControl)
MapPathSecure(String)

仮想パス (絶対パスまたは相対パス) の割り当て先の物理パスを取得します。

(継承元 Control)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
MergeStyle(Style)

指定したスタイルの空白以外の要素を Web コントロールにコピーしますが、コントロールの既存のスタイル要素は上書きしません。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
OnBubbleEvent(Object, EventArgs)

ページの ASP.NET サーバー コントロールの上位階層にイベントを渡すかどうかを決定します。

OnDataBinding(EventArgs)

DataBinding イベントを発生させます。

(継承元 Control)
OnInit(EventArgs)

Init イベントを発生させます。

(継承元 Control)
OnLoad(EventArgs)

Load イベントを発生させます。

(継承元 Control)
OnPreRender(EventArgs)

PreRender イベントを発生させます。

(継承元 Control)
OnUnload(EventArgs)

Unload イベントを発生させます。

(継承元 Control)
OpenFile(String)

ファイルの読み込みで使用される Stream を取得します。

(継承元 Control)
RaiseBubbleEvent(Object, EventArgs)

イベントのソースおよびその情報をコントロールの親に割り当てます。

(継承元 Control)
RemovedControl(Control)

Control オブジェクトの Controls コレクションから子コントロールが削除された後に呼び出されます。

(継承元 Control)
Render(HtmlTextWriter)

指定された HTML ライターにコントロールを描画します。

(継承元 WebControl)
RenderBeginTag(HtmlTextWriter)

コントロールの HTML 開始タグを指定したライターに表示します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
RenderChildren(HtmlTextWriter)

提供された HtmlTextWriter オブジェクトに対してサーバー コントロールの子のコンテンツを出力すると、クライアントで表示されるコンテンツが記述されます。

(継承元 Control)
RenderContents(HtmlTextWriter)

コントロールの内容を指定したライターに出力します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
RenderControl(HtmlTextWriter)

指定の HtmlTextWriter オブジェクトにサーバー コントロールの内容を出力し、トレースが有効である場合はコントロールに関するトレース情報を保存します。

(継承元 Control)
RenderControl(HtmlTextWriter, ControlAdapter)

指定した ControlAdapter オブジェクトを使用して、指定した HtmlTextWriter オブジェクトにサーバー コントロールの内容を出力します。

(継承元 Control)
RenderEndTag(HtmlTextWriter)

コントロールの HTML 終了タグを指定したライターに表示します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
ResolveAdapter()

指定したコントロールを表示するコントロール アダプターを取得します。

(継承元 Control)
ResolveClientUrl(String)

ブラウザーで使用できる URL を取得します。

(継承元 Control)
ResolveUrl(String)

要求側クライアントで使用できる URL に変換します。

(継承元 Control)
SaveControlState()

ページがサーバーにポスト バックされた時間以降に発生したすべてのサーバー コントロール状態の変化を保存します。

(継承元 Control)
SaveViewState()

TrackViewState() メソッドが呼び出された後に変更された状態を保存します。

(継承元 WebControl)
SetDesignModeState(IDictionary)

コントロールのデザイン時データを設定します。

(継承元 Control)
SetRenderMethodDelegate(RenderMethod)

サーバー コントロールとその内容を親コントロールに表示するイベント ハンドラー デリゲートを割り当てます。

(継承元 Control)
SetTraceData(Object, Object)

トレース データ キーとトレース データ値を使用して、レンダリング データのデザイン時トレースのトレース データを設定します。

(継承元 Control)
SetTraceData(Object, Object, Object)

トレースされたオブジェクト、トレース データ キー、およびトレース データ値を使用して、レンダリング データのデザイン時トレースのトレース データを設定します。

(継承元 Control)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
TrackViewState()

コントロールでそのビュー ステートの変化を追跡して、その変化をオブジェクトの ViewState プロパティに保存できるようにします。

(継承元 WebControl)

イベント

DataBinding

サーバー コントロールがデータ ソースに連結すると発生します。

(継承元 Control)
Disposed

サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。

(継承元 Control)
Init

サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。

(継承元 Control)
Load

サーバー コントロールが Page オブジェクトに読み込まれると発生します。

(継承元 Control)
PreRender

Control オブジェクトの読み込み後、表示を開始する前に発生します。

(継承元 Control)
Unload

サーバー コントロールがメモリからアンロードされると発生します。

(継承元 Control)

明示的なインターフェイスの実装

IAttributeAccessor.GetAttribute(String)

指定された名前の Web コントロールの属性を取得します。

(継承元 WebControl)
IAttributeAccessor.SetAttribute(String, String)

Web コントロールの属性を指定された名前と値に設定します。

(継承元 WebControl)
IControlBuilderAccessor.ControlBuilder

このメンバーの詳細については、「ControlBuilder」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.GetDesignModeState()

このメンバーの詳細については、「GetDesignModeState()」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary)

このメンバーの詳細については、「SetDesignModeState(IDictionary)」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.SetOwnerControl(Control)

このメンバーの詳細については、「SetOwnerControl(Control)」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.UserData

このメンバーの詳細については、「UserData」をご覧ください。

(継承元 Control)
IDataBindingsAccessor.DataBindings

このメンバーの詳細については、「DataBindings」をご覧ください。

(継承元 Control)
IDataBindingsAccessor.HasDataBindings

このメンバーの詳細については、「HasDataBindings」をご覧ください。

(継承元 Control)
IDataItemContainer.DataItem

このメンバーの詳細については、「DataItem」をご覧ください。

IDataItemContainer.DataItemIndex

このメンバーの詳細については、「DataItemIndex」をご覧ください。

IDataItemContainer.DisplayIndex

このメンバーの詳細については、「DisplayIndex」をご覧ください。

IExpressionsAccessor.Expressions

このメンバーの詳細については、「Expressions」をご覧ください。

(継承元 Control)
IExpressionsAccessor.HasExpressions

このメンバーの詳細については、「HasExpressions」をご覧ください。

(継承元 Control)
IParserAccessor.AddParsedSubObject(Object)

このメンバーの詳細については、「AddParsedSubObject(Object)」をご覧ください。

(継承元 Control)

拡張メソッド

FindDataSourceControl(Control)

指定されたコントロールのデータ コントロールに関連付けられているデータ ソースを返します。

FindFieldTemplate(Control, String)

指定されたコントロールの名前付けコンテナー内にある、指定された列のフィールド テンプレートを返します。

FindMetaTable(Control)

格納しているデータ コントロールのメタテーブル オブジェクトを返します。

GetDefaultValues(INamingContainer)

指定されたデータ コントロールの既定値のコレクションを取得します。

GetMetaTable(INamingContainer)

指定されたデータ コントロールのテーブル メタデータを取得します。

SetMetaTable(INamingContainer, MetaTable)

指定されたデータ コントロールのテーブル メタデータを設定します。

SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)

指定したデータ コントロールのテーブル メタデータおよび既定値のマッピングを設定します。

SetMetaTable(INamingContainer, MetaTable, Object)

指定したデータ コントロールのテーブル メタデータおよび既定値のマッピングを設定します。

TryGetMetaTable(INamingContainer, MetaTable)

テーブル メタデータが使用できるかどうかを判断します。

EnableDynamicData(INamingContainer, Type)

指定されたデータ コントロールの動的データの動作を有効にします。

EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)

指定されたデータ コントロールの動的データの動作を有効にします。

EnableDynamicData(INamingContainer, Type, Object)

指定されたデータ コントロールの動的データの動作を有効にします。

適用対象

こちらもご覧ください