ButtonFieldとは? わかりやすく解説

ButtonField クラス

メモ : このクラスは、.NET Framework version 2.0 で新しく追加されたものです。

データ バインド コントロールにボタンとして表示されるフィールドを表します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Class ButtonField
    Inherits ButtonFieldBase
public class ButtonField : ButtonFieldBase
public ref class ButtonField : public
 ButtonFieldBase
public class ButtonField extends ButtonFieldBase
public class ButtonField extends
 ButtonFieldBase
解説解説

データ バインド コントロール (GridView、DetailsView など) は、この ButtonField クラスを使用して、各レコードを表示するためのボタンを表示します。ButtonField オブジェクトは、そのオブジェクトを使用しているデータ バインド コントロールにより異なった形式で表示されます。たとえば、ButtonField オブジェクトは、GridView コントロールでは列として表示され、DetailsView コントロールでは行として表示されます。

ボタン フィールドのボタンをクリックすると、親データ バインド コントロールのコマンド イベントが発生します。コマンド イベントのイベント ハンドラを用意すると、コマンド ボタンがクリックされたときにカスタム ルーチンを実行できます。

メモメモ

GridView コントロールは RowCommand イベントを発生させます。一方、DetailsView コントロールは ItemCommand イベントを発生させます。

コマンド イベントを発生させたレコードのインデックスを特定するには、データ バインド コントロールのコマンド イベントに渡されるイベント引数の CommandArgument プロパティを使用します。ButtonField クラスは、適切なインデックス値を持つ CommandArgument プロパティを自動的に作成します。

表示するボタンの型を指定するには、ButtonType プロパティを使用します。リンクまたはコマンド ボタンを表示する場合、Text プロパティを使用してボタンに表示されるキャプションを指定します。

ButtonField オブジェクトをデータ ソースのフィールドにバインドすることでも同じ設定を行うことができます。この方法で設定すると、ButtonField オブジェクトの各ボタンで異なるキャプションを表示できます。ボタンのテキスト キャプションには、指定したフィールドの値が使用されます。ButtonField オブジェクトをデータ ソースのフィールドにバインドするには、DataTextField プロパティを設定します。

イメージ ボタンを表示する場合、ImageUrl プロパティを使用して、ButtonField オブジェクトのボタンに表示するイメージを指定します。

メモメモ

ButtonField オブジェクトのボタンはすべて同じイメージを共有します。

Visible プロパティを false に設定すると、データ バインド コントロールの ButtonField オブジェクトを非表示にできます。

ButtonField オブジェクトでは、ヘッダーおよびフッター セクションをカスタマイズできます。ヘッダーまたはフッター セクションのキャプションを表示するには、HeaderText または FooterText プロパティをそれぞれ設定します。HeaderImageUrl プロパティを設定すると、ヘッダー セクションにテキストを表示する代わりにイメージを表示できます。ButtonField オブジェクトのヘッダー セクションを非表示にするには、 ShowHeader プロパティを false に設定します。

また、フィールドの各部分にスタイル プロパティを設定すると、ButtonField オブジェクトの外観 (フォントの色や背景色など) をカスタマイズできます。さまざまなスタイル プロパティの一覧を次の表に示します。

スタイル プロパティ

スタイル設定の対象

ControlStyle

ButtonField の子 Web サーバー コントロール。

FooterStyle

ButtonField のフッター セクション。

HeaderStyle

ButtonField のヘッダー セクション。

ItemStyle

ButtonField のデータ項目。

使用例使用例

ButtonField オブジェクトを使用して、GridView コントロールにコマンド ボタンの列を表示する方法を次のコード例に示します。

<%@ Page language="VB" %>


<script runat="server">

    Sub CustomersGridView_RowCommand(ByVal
 sender As Object, ByVal
 e As GridViewCommandEventArgs)
  
        ' If multiple ButtonField column fields are used, use the
        ' CommandName property to determine which button was clicked.
        If e.CommandName = "Select"
 Then
    
            ' Convert the row index stored in the CommandArgument
            ' property to an Integer.
            Dim index As Integer
 = Convert.ToInt32(e.CommandArgument)
    
            ' Get the last name of the selected author from the appropriate
            ' cell in the GridView control.
            Dim selectedRow As GridViewRow
 = CustomersGridView.Rows(index)
            Dim contactCell As TableCell =
 selectedRow.Cells(1)
            Dim contact As String
 = contactCell.Text
    
            ' Display the selected author.
            Message.Text = "You selected " & contact
 & "."
      
        End If
    
    End Sub
    
</script>

<html>
  <body>
    <form id="Form1" runat="server">
        
      <h3>ButtonField Example</h3>
      
      <asp:label id="Message"
        forecolor="Red"
        runat="server"/>
                    
      <!-- Populate the Columns collection declaratively. -->
      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="false"
        onrowcommand="CustomersGridView_RowCommand"
        runat="server">
                
        <columns>
                
          <asp:buttonfield buttontype="Button"
 
            commandname="Select"
            headertext="Select Customer" 
            text="Select"/>
          <asp:boundfield datafield="CompanyName"
 
            headertext="Company Name"/>
          <asp:boundfield datafield="ContactName"
 
            headertext="Contact Name"/>
                
        </columns>
                
      </asp:gridview>
            
        <!-- This example uses Microsoft SQL Server and connects
 -->
        <!-- to the Northwind sample database.            
       -->
        <asp:sqldatasource id="CustomersSqlDataSource"
  
          selectcommand="Select [CustomerID], [CompanyName], [ContactName],
 [ContactTitle] From [Customers]"
          connectionstring="<%$ ConnectionStrings:NorthWindConnection%>"
          runat="server">
        </asp:sqldatasource>
            
    </form>
  </body>
</html>

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

<script runat="server">

  void CustomersGridView_RowCommand(Object sender, GridViewCommandEventArgs
 e)
  {
  
    // If multiple ButtonField column fields are used, use the
    // CommandName property to determine which button was clicked.
    if(e.CommandName=="Select")
    {
    
      // Convert the row index stored in the CommandArgument
      // property to an Integer.
      int index = Convert.ToInt32(e.CommandArgument);    
    
      // Get the last name of the selected author from the appropriate
      // cell in the GridView control.
      GridViewRow selectedRow = CustomersGridView.Rows[index];
      TableCell contactName = selectedRow.Cells[1];
      string contact = contactName.Text;  
    
      // Display the selected author.
      Message.Text = "You selected " + contact + ".";
      
    }
    
  }
    
</script>

<html>
  <body>
    <form runat="server">
        
      <h3>ButtonField Example</h3>
      
      <asp:label id="Message"
        forecolor="Red"
        runat="server"/>
                    
      <!-- Populate the Columns collection declaratively. -->
      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="false"
        onrowcommand="CustomersGridView_RowCommand"
        runat="server">
                
        <columns>
                
          <asp:buttonfield buttontype="Button" 
            commandname="Select"
            headertext="Select Customer" 
            text="Select"/>
          <asp:boundfield datafield="CompanyName" 
            headertext="Company Name"/>
          <asp:boundfield datafield="ContactName" 
            headertext="Contact Name"/>
                
        </columns>
                
      </asp:gridview>
            
        <!-- This example uses Microsoft SQL Server and connects -->
        <!-- to the Northwind sample database.                   -->
        <asp:sqldatasource id="CustomersSqlDataSource"  
          selectcommand="Select [CustomerID], [CompanyName], [ContactName],
 [ContactTitle] From [Customers]"
          connectionstring="<%$ ConnectionStrings:NorthWindConnection%>"
          runat="server">
        </asp:sqldatasource>
            
    </form>
  </body>
</html>

.NET Framework のセキュリティ.NET Framework のセキュリティ
継承階層継承階層
System.Object
   System.Web.UI.WebControls.DataControlField
     System.Web.UI.WebControls.ButtonFieldBase
      System.Web.UI.WebControls.ButtonField
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ButtonField メンバ
System.Web.UI.WebControls 名前空間
GridView
Columns
RowCommand
ShowHeader
DetailsView
ItemCommand
Rows
BoundField クラス
ButtonFieldBase
CheckBoxField
CommandField
DataControlField
HyperLinkField
TemplateField
ButtonType
DataTextField
ImageUrl
Text
Visible

ButtonField コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

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

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

public ButtonField ()
public:
ButtonField ()
public ButtonField ()
解説解説
使用例使用例

M:System.Web.UI.WebControls.ButtonField.#ctor コンストラクタを使用して、ButtonField オブジェクトを GridView コントロールに動的に追加する方法を次のコード例に示します。

<%@ Page language="VB" %>

<script runat="server">

    Sub CustomersGridView_RowCommand(ByVal
 sender As Object, ByVal
 e As GridViewCommandEventArgs)
  
        ' If multiple ButtonField column fields are used, use the
        ' CommandName property to determine which button was clicked.
        If e.CommandName = "Select"
 Then
    
            ' Convert the row index stored in the CommandArgument
            ' property to an Integer.
            Dim index As Integer
 = Convert.ToInt32(e.CommandArgument)
    
            ' Get the last name of the selected Customer from the appropriate
            ' cell in the GridView control.
            Dim selectedRow As GridViewRow
 = CustomersGridView.Rows(index)
            Dim contactNameCell As TableCell
 = selectedRow.Cells(1)
            Dim contactName As String
 = contactNameCell.Text
    
            ' Display the selected Customer.
            Message.Text = "You selected " & contactName
 & "."
      
        End If
    
    End Sub

    Sub Page_Load(ByVal sender As
 Object, ByVal e As EventArgs)
  
        ' The field columns need to be created only the first time
        ' the page is loaded.
        If Not IsPostBack Then
      
            ' Dynamically create field columns to display the desired
            ' fields from the data source.
      
            ' Create a ButtonField object to allow the user to 
            ' select an Customer.
            Dim selectButtonField As New
 ButtonField

            selectButtonField.ButtonType = ButtonType.Button
            selectButtonField.CommandName = "Select"
            selectButtonField.HeaderText = "Select Customer"
            selectButtonField.Text = "Select"

            ' Create a BoundField object to display an Customer's last
 name.
            Dim contactNameBoundField As New
 BoundField

            contactNameBoundField.DataField = "ContactName"
            contactNameBoundField.HeaderText = "Contact Name"

            ' Create a BoundField object to display an Customer's first
 name.
            Dim contactTitleBoundField As New
 BoundField

            contactTitleBoundField.DataField = "ContactTitle"
            contactTitleBoundField.HeaderText = "Contact Title"

            ' Add the field columns to the Columns collection of the
            ' GridView control.
            CustomersGridView.Columns.Add(selectButtonField)
            CustomersGridView.Columns.Add(contactNameBoundField)
            CustomersGridView.Columns.Add(contactTitleBoundField)
      
        End If
    
    End Sub

</script>

<html>
  <body>
    <form id="Form1" runat="server">
        
      <h3>ButtonField Constructor Example</h3>

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

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="False"
        onrowcommand="CustomersGridView_RowCommand"
        runat="server">                
      </asp:gridview>
            
        <!-- This example uses Microsoft SQL Server and connects
 -->
        <!-- to the Northwind sample database.            
       -->
        <asp:sqldatasource id="CustomersSqlDataSource"
  
          selectcommand="Select [CustomerID], [CompanyName], [ContactName],
 [ContactTitle] From [Customers]"
          connectionstring="<%$ ConnectionStrings:NorthWindConnection%>"
          runat="server">
        </asp:sqldatasource>
            
    </form>
  </body>
</html>

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

<script runat="server">

  void CustomersGridView_RowCommand(Object sender, GridViewCommandEventArgs
 e)
  {
  
    // If multiple ButtonField column fields are used, use the
    // CommandName property to determine which button was clicked.
    if(e.CommandName=="Select")
    {
    
      // Convert the row index stored in the CommandArgument
      // property to an Integer.
      int index = Convert.ToInt32(e.CommandArgument);    
    
      // Get the last name of the selected Customer from the appropriate
      // cell in the GridView control.
      GridViewRow selectedRow = CustomersGridView.Rows[index];
      TableCell contactCell = selectedRow.Cells[1];
      string contact = contactCell.Text;  
    
      // Display the selected Customer.
      Message.Text = "You selected " + contact + ".";
      
    }
    
  }

  void Page_Load(Object sender, EventArgs e)
  {
  
    // The field columns need to be created only the first time
    // the page is loaded.
    if (!IsPostBack)
    {
      
      // Dynamically create field columns to display the desired
      // fields from the data source.
      
      // Create a ButtonField object to allow the user to 
      // select an Customer.
      ButtonField selectButtonField = new ButtonField ();

      selectButtonField.ButtonType = ButtonType.Button;
      selectButtonField.CommandName = "Select";
      selectButtonField.HeaderText = "Select Customer";
      selectButtonField.Text = "Select";

      // Create a BoundField object to display an Customer's last name.
      BoundField contactNameBoundField = new BoundField();

      contactNameBoundField.DataField = "ContactName";
      contactNameBoundField.HeaderText = "Contact Name";

      // Create a BoundField object to display an Customer's first name.
      BoundField contactTitleBoundField = new BoundField();

      contactTitleBoundField.DataField = "ContactTitle";
      contactTitleBoundField.HeaderText = "Contact Title";

      // Add the field columns to the Columns collection of the
      // GridView control.
      CustomersGridView.Columns.Add (selectButtonField);
      CustomersGridView.Columns.Add(contactNameBoundField);
      CustomersGridView.Columns.Add(contactTitleBoundField);
      
    }
    
  }

</script>

<html>
  <body>
    <form runat="server">
        
      <h3>ButtonField Constructor Example</h3>

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

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="False"
        onrowcommand="CustomersGridView_RowCommand"
        runat="server">                
      </asp:gridview>
            
        <!-- This example uses Microsoft SQL Server and connects -->
        <!-- to the Northwind sample database.                   -->
        <asp:sqldatasource id="CustomersSqlDataSource"  
          selectcommand="Select [CustomerID], [CompanyName], [ContactName],
 [ContactTitle] From [Customers]"
          connectionstring="<%$ ConnectionStrings:NorthWindConnection%>"
          runat="server">
        </asp:sqldatasource>
            
    </form>
  </body>
</html>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ButtonField クラス
ButtonField メンバ
System.Web.UI.WebControls 名前空間
GridView
Columns
DetailsView
Fields

ButtonField プロパティ


パブリック プロパティパブリック プロパティ

( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ AccessibleHeaderText  一部のコントロールの AbbreviatedText プロパティ値として表示されるテキストを取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ ButtonType  ボタン フィールドに表示するボタンの種類を取得または設定します。 ( ButtonFieldBase から継承されます。)
パブリック プロパティ CausesValidation  ButtonFieldBase オブジェクトのボタンがクリックされたときに検証を実行するかどうかを示す値を取得または設定します。 ( ButtonFieldBase から継承されます。)
パブリック プロパティ CommandName ButtonField オブジェクトのボタンがクリックされたときに実行されるアクションを表す文字列を取得または設定します。
パブリック プロパティ ControlStyle  DataControlField オブジェクトに格納されているすべての Web サーバー コントロールのスタイルを取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ DataTextField ButtonField オブジェクトが表示する Button コントロールの Text プロパティにバインドされている値のデータ フィールド名を取得または設定します。
パブリック プロパティ DataTextFormatString フィールドの値の表示形式を指定する文字列を取得または設定します。
パブリック プロパティ FooterStyle  データ コントロール フィールドのフッターのスタイルを取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ FooterText  データ コントロール フィールドのフッター項目に表示されるテキストを取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ HeaderImageUrl  データ コントロール フィールドのヘッダー項目に表示されるイメージの URL を取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ HeaderStyle  データ コントロール フィールドのヘッダーのスタイルを取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ HeaderText  データ コントロール フィールドのヘッダー項目に表示されるテキストを取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ ImageUrl ButtonField オブジェクトの各ボタンに表示されるイメージを取得または設定します。
パブリック プロパティ InsertVisible  DataControlField オブジェクトの親データ バインド コントロールが挿入モードの場合に、このオブジェクトが表示されるかどうかを示す値を取得します。 ( DataControlField から継承されます。)
パブリック プロパティ ItemStyle  データ コントロール フィールドで表示されるテキスト ベースの内容のスタイルを取得します。 ( DataControlField から継承されます。)
パブリック プロパティ ShowHeader  ButtonFieldBase オブジェクトにヘッダー セクションを表示するかどうかを示す値を取得または設定します。 ( ButtonFieldBase から継承されます。)
パブリック プロパティ SortExpression  データ ソース コントロールでデータを並べ替えるために使用される並べ替え式を、取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ Text ButtonField オブジェクトの各ボタンに表示される静的キャプションを取得または設定します。
パブリック プロパティ ValidationGroup  ButtonFieldBase オブジェクトのボタンがクリックされたときに検証する検証コントロールのグループの名前を取得または設定します。 ( ButtonFieldBase から継承されます。)
パブリック プロパティ Visible  データ コントロール フィールドを表示するかどうかを示す値を取得または設定します。 ( DataControlField から継承されます。)
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ Control  DataControlField オブジェクトが関連付けられているデータ コントロールの参照を取得します。 ( DataControlField から継承されます。)
プロテクト プロパティ DesignMode  デザイン時環境で、現在データ コントロール フィールドが表示されているかどうかを示す値を取得します。 ( DataControlField から継承されます。)
プロテクト プロパティ IsTrackingViewState  DataControlField オブジェクトがビューステートへの変更を保存しているかどうかを示す値を取得します。 ( DataControlField から継承されます。)
プロテクト プロパティ ViewState  同一のページに対する複数の要求にわたって、DataControlField オブジェクトのビューステートを保存し、復元できるようにする状態情報のディクショナリを取得します。 ( DataControlField から継承されます。)
参照参照

関連項目

ButtonField クラス
System.Web.UI.WebControls 名前空間
GridView
Columns
RowCommand
ShowHeader
DetailsView
ItemCommand
Rows
BoundField クラス
ButtonFieldBase
CheckBoxField
CommandField
DataControlField
HyperLinkField
TemplateField
ButtonType
DataTextField
ImageUrl
Text
Visible

ButtonField メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。)
パブリック メソッド ExtractValuesFromCell  現在のテーブル セルからデータ コントロール フィールドの値を抽出し、指定した IDictionary コレクションにその値を追加します。 ( DataControlField から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 ( Object から継承されます。)
パブリック メソッド Initialize オーバーライドされます。 現在の ButtonField オブジェクトを初期化します。
パブリック メソッド InitializeCell オーバーライドされます。 指定された DataControlFieldCell オブジェクトを、指定された行の状態に初期化します。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。)
パブリック メソッド ToString  この DataControlField オブジェクトを表す文字列を返します。 ( DataControlField から継承されます。)
パブリック メソッド ValidateSupportsCallback オーバーライドされます。 ButtonField オブジェクトに格納されているコントロールがコールバックをサポートしているかどうかを確認します。
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド CloneField  現在の DataControlField 派生オブジェクトのコピーを作成します。 ( DataControlField から継承されます。)
プロテクト メソッド CopyProperties オーバーライドされます。 ButtonField オブジェクトの現在のプロパティを、指定された DataControlField オブジェクトにコピーします。
プロテクト メソッド CreateField オーバーライドされます。 ButtonField クラスの新しいインスタンスを作成して返します。
プロテクト メソッド Finalize  Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。)
プロテクト メソッド FormatDataTextValue ButtonField オブジェクトのセルの指定されたフィールド値の書式を変換します。
プロテクト メソッド LoadViewState  データ ソース ビューの、以前保存したビューステートを復元します。 ( DataControlField から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object の簡易コピーを作成します。 ( Object から継承されます。)
プロテクト メソッド OnFieldChanged  FieldChanged イベントを発生させます。 ( DataControlField から継承されます。)
プロテクト メソッド SaveViewState  ページがサーバーにポストバックされた時間以降に発生した、DataControlField ビューステートへの変更を保存します。 ( DataControlField から継承されます。)
プロテクト メソッド TrackViewState  DataControlField オブジェクトがそのビューステートの変更を追跡するようにします。それにより、変更をコントロールの ViewState プロパティに格納して、同じページに対する複数の要求にわたって永続化できます。 ( DataControlField から継承されます。)
参照参照

関連項目

ButtonField クラス
System.Web.UI.WebControls 名前空間
GridView
Columns
RowCommand
ShowHeader
DetailsView
ItemCommand
Rows
BoundField クラス
ButtonFieldBase
CheckBoxField
CommandField
DataControlField
HyperLinkField
TemplateField
ButtonType
DataTextField
ImageUrl
Text
Visible

ButtonField メンバ

データ バインド コントロールにボタンとして表示されるフィールドを表します。

ButtonField データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド ButtonField ButtonField クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ AccessibleHeaderText  一部のコントロールの AbbreviatedText プロパティ値として表示されるテキストを取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ ButtonType  ボタン フィールドに表示するボタンの種類を取得または設定します。(ButtonFieldBase から継承されます。)
パブリック プロパティ CausesValidation  ButtonFieldBase オブジェクトのボタンがクリックされたときに検証を実行するかどうかを示す値を取得または設定します。(ButtonFieldBase から継承されます。)
パブリック プロパティ CommandName ButtonField オブジェクトのボタンがクリックされたときに実行されるアクションを表す文字列を取得または設定します。
パブリック プロパティ ControlStyle  DataControlField オブジェクトに格納されているすべての Web サーバー コントロールのスタイルを取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ DataTextField ButtonField オブジェクトが表示する Button コントロールの Text プロパティにバインドされている値のデータ フィールド名を取得または設定します。
パブリック プロパティ DataTextFormatString フィールドの値の表示形式を指定する文字列を取得または設定します。
パブリック プロパティ FooterStyle  データ コントロール フィールドのフッターのスタイルを取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ FooterText  データ コントロール フィールドのフッター項目に表示されるテキストを取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ HeaderImageUrl  データ コントロール フィールドのヘッダー項目に表示されるイメージの URL を取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ HeaderStyle  データ コントロール フィールドのヘッダーのスタイルを取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ HeaderText  データ コントロール フィールドのヘッダー項目に表示されるテキストを取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ ImageUrl ButtonField オブジェクトの各ボタンに表示されるイメージを取得または設定します。
パブリック プロパティ InsertVisible  DataControlField オブジェクトの親データ バインド コントロールが挿入モードの場合に、このオブジェクトが表示されるかどうかを示す値を取得します。(DataControlField から継承されます。)
パブリック プロパティ ItemStyle  データ コントロール フィールドで表示されるテキスト ベースの内容のスタイルを取得します。(DataControlField から継承されます。)
パブリック プロパティ ShowHeader  ButtonFieldBase オブジェクトにヘッダー セクションを表示するかどうかを示す値を取得または設定します。(ButtonFieldBase から継承されます。)
パブリック プロパティ SortExpression  データ ソース コントロールでデータを並べ替えるために使用される並べ替え式を、取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ Text ButtonField オブジェクトの各ボタンに表示される静的キャプションを取得または設定します。
パブリック プロパティ ValidationGroup  ButtonFieldBase オブジェクトのボタンがクリックされたときに検証する検証コントロールのグループの名前を取得または設定します。(ButtonFieldBase から継承されます。)
パブリック プロパティ Visible  データ コントロール フィールドを表示するかどうかを示す値を取得または設定します。(DataControlField から継承されます。)
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ Control  DataControlField オブジェクトが関連付けられているデータ コントロールの参照を取得します。(DataControlField から継承されます。)
プロテクト プロパティ DesignMode  デザイン時環境で、現在データ コントロール フィールドが表示されているかどうかを示す値を取得します。(DataControlField から継承されます。)
プロテクト プロパティ IsTrackingViewState  DataControlField オブジェクトがビューステートへの変更を保存しているかどうかを示す値を取得します。(DataControlField から継承されます。)
プロテクト プロパティ ViewState  同一のページに対する複数の要求にわたって、DataControlField オブジェクトのビューステートを保存し、復元できるようにする状態情報のディクショナリを取得します。(DataControlField から継承されます。)
パブリック メソッドパブリック メソッド
( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。)
パブリック メソッド ExtractValuesFromCell  現在のテーブル セルからデータ コントロール フィールドの値を抽出し、指定した IDictionary コレクションにその値を追加します。 (DataControlField から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 (Object から継承されます。)
パブリック メソッド Initialize オーバーライドされます。 現在の ButtonField オブジェクトを初期化します。
パブリック メソッド InitializeCell オーバーライドされます。 指定された DataControlFieldCell オブジェクトを、指定された行の状態に初期化します。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。)
パブリック メソッド ToString  この DataControlField オブジェクトを表す文字列を返します。 (DataControlField から継承されます。)
パブリック メソッド ValidateSupportsCallback オーバーライドされます。 ButtonField オブジェクトに格納されているコントロールがコールバックをサポートしているかどうかを確認します。
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド CloneField  現在の DataControlField 派生オブジェクトのコピーを作成します。 (DataControlField から継承されます。)
プロテクト メソッド CopyProperties オーバーライドされます。 ButtonField オブジェクトの現在のプロパティを、指定された DataControlField オブジェクトにコピーします。
プロテクト メソッド CreateField オーバーライドされます。 ButtonField クラスの新しいインスタンスを作成して返します。
プロテクト メソッド Finalize  Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。)
プロテクト メソッド FormatDataTextValue ButtonField オブジェクトのセルの指定されたフィールド値の書式を変換します。
プロテクト メソッド LoadViewState  データ ソース ビューの、以前保存したビューステートを復元します。 (DataControlField から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object の簡易コピーを作成します。 (Object から継承されます。)
プロテクト メソッド OnFieldChanged  FieldChanged イベントを発生させます。 (DataControlField から継承されます。)
プロテクト メソッド SaveViewState  ページがサーバーにポストバックされた時間以降に発生した、DataControlField ビューステートへの変更を保存します。 (DataControlField から継承されます。)
プロテクト メソッド TrackViewState  DataControlField オブジェクトがそのビューステートの変更を追跡するようにします。それにより、変更をコントロールの ViewState プロパティに格納して、同じページに対する複数の要求にわたって永続化できます。 (DataControlField から継承されます。)
参照参照

関連項目

ButtonField クラス
System.Web.UI.WebControls 名前空間
GridView
Columns
RowCommand
ShowHeader
DetailsView
ItemCommand
Rows
BoundField クラス
ButtonFieldBase
CheckBoxField
CommandField
DataControlField
HyperLinkField
TemplateField
ButtonType
DataTextField
ImageUrl
Text
Visible



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「ButtonField」の関連用語

ButtonFieldのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ButtonFieldのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS