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

CommandField クラス

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

データ バインド コントロール選択編集挿入、または削除の各操作実行するコマンド ボタン表示する特殊なフィールド表します

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

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

CommandField クラスは、データ バインド コントロール (GridView および DetailsView など) で使用される特殊なフィールドで、削除編集挿入、または選択の各操作実行するコマンド ボタン表示します。これらの操作実行するコマンド ボタンは、次の表に示すプロパティ使用して表示または非表示できます

プロパティ

説明

ShowDeleteButton

データ バインド コントロール内のレコードごとに、CommandField フィールドDelete ボタン表示または非表示にします。Delete ボタン使用すると、ユーザーデータ ソースからレコード削除できます

ShowEditButton

データ バインド コントロール内のレコードごとに、CommandField フィールドEdit ボタン表示または非表示にします。Edit ボタン使用すると、ユーザーデータ ソースレコード編集できますユーザー特定のレコードEdit ボタンクリックすると、Edit ボタンUpdate ボタンCancel ボタンに置き換わりますその他のコマンド ボタンもすべて非表示なります

ShowInsertButton

CommandField フィールドNew ボタン表示または非表示にします。New ボタン使用すると、ユーザーデータ ソース新しレコード挿入できますユーザーNew ボタンクリックすると、Insert ボタンCancel ボタンに置き換わりますその他のコマンド ボタンもすべて非表示なります

ShowSelectButton

データ バインド コントロール内のレコードごとに、CommandField フィールドSelect ボタン表示または非表示にします。Select ボタン使用すると、ユーザーデータ バインド コントロール内のレコード選択できます

また、ShowCancelButton プロパティ設定することにより、レコード編集モードまたは挿入モードのときに表示される Cancel ボタン表示または非表示にすることもできます

CommandField フィールドは、それが使用されているデータ バインド コントロールによって表示異なります。たとえば、CommandField フィールドは、GridView コントロールでは列として表示されDetailsView コントロールでは行として表示されます。

表示するボタンの種類指定するには、ButtonType プロパティ使用しますButtonType プロパティButtonType.Button または ButtonType.Link設定されている場合次の表に示すプロパティ設定してボタン表示するテキスト指定できます

コマンド ボタンまたはリンク ボタン表示する代わりにButtonType プロパティButtonType.Image設定し次の表に示すプロパティ設定してイメージ ボタン表示できます

既定では、ユーザーCommandField フィールドボタンクリックすると、ページすべての検証コントロール検証実行されます。ボタンクリックしたときに検証が行われないようにするには、CausesValidation プロパティfalse設定します

Visible プロパティfalse設定すると、データ バインド コントロールCommandField フィールドを非表示できます

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

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

使用例使用例

CommandField フィールド使用してコントロール表示しGridView コントロール内のレコード編集する方法次のコード例示します

<%@ Page language="VB" %>

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

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="false"
        datakeynames="CustomerID"  
        runat="server">
        
        <columns>
          <asp:commandfield showeditbutton="true"
            headertext="Edit Controls"/>
          <asp:boundfield datafield="CustomerID"
            headertext="Customer ID" />
          <asp:boundfield datafield="CompanyName"
            headertext="Company Name"/>
          <asp:boundfield datafield="Address"
            headertext="Address"/>
          <asp:boundfield datafield="City"
            headertext="City"/>
          <asp:boundfield datafield="PostalCode"
            headertext="ZIP Code"/>
          <asp:boundfield datafield="Country"
            headertext="Country"/>
        </columns>
        
      </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]"
        updatecommand="Update Customers Set CompanyName=@CompanyName,
 Address=@Address, City=@City, PostalCode=@PostalCode, Country=@Country Where (CustomerID
 = @CustomerID)"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

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

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

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="false"
        datakeynames="CustomerID"  
        runat="server">
        
        <columns>
          <asp:commandfield showeditbutton="true"
            headertext="Edit Controls"/>
          <asp:boundfield datafield="CustomerID"
            headertext="Customer ID" />
          <asp:boundfield datafield="CompanyName"
            headertext="Company Name"/>
          <asp:boundfield datafield="Address"
            headertext="Address"/>
          <asp:boundfield datafield="City"
            headertext="City"/>
          <asp:boundfield datafield="PostalCode"
            headertext="ZIP Code"/>
          <asp:boundfield datafield="Country"
            headertext="Country"/>
        </columns>
        
      </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]"
        updatecommand="Update Customers Set CompanyName=@CompanyName, Address=@Address,
 City=@City, PostalCode=@PostalCode, Country=@Country Where (CustomerID = @CustomerID)"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

CancelTextEditText、および UpdateText の各プロパティ使用して編集コントロールテキストカスタマイズする方法次のコード例示します

<%@ Page language="VB" %>

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

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="false"
        datakeynames="CustomerID"  
        runat="server">
        
        <columns>
          <asp:commandfield showeditbutton="true"
            edittext="Edit Customer"
            canceltext="Discard"
            updatetext="Revise"
            headertext="Edit Controls"/>
          <asp:boundfield datafield="CustomerID"
            headertext="Customer ID" />
          <asp:boundfield datafield="CompanyName"
            headertext="Company Name"/>
          <asp:boundfield datafield="Address"
            headertext="Address"/>
          <asp:boundfield datafield="City"
            headertext="City"/>
          <asp:boundfield datafield="PostalCode"
            headertext="ZIP Code"/>
          <asp:boundfield datafield="Country"
            headertext="Country"/>
        </columns>
        
      </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]"
        updatecommand="Update Customers Set CompanyName=@CompanyName,
 Address=@Address, City=@City, PostalCode=@PostalCode, Country=@Country Where (CustomerID
 = @CustomerID)"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

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

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

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="false"
        datakeynames="CustomerID"  
        runat="server">
        
        <columns>
          <asp:commandfield showeditbutton="true"
            edittext="Edit Customer"
            canceltext="Discard"
            updatetext="Revise"
            headertext="Edit Controls"/>
          <asp:boundfield datafield="CustomerID"
            headertext="Customer ID" />
          <asp:boundfield datafield="CompanyName"
            headertext="Company Name"/>
          <asp:boundfield datafield="Address"
            headertext="Address"/>
          <asp:boundfield datafield="City"
            headertext="City"/>
          <asp:boundfield datafield="PostalCode"
            headertext="ZIP Code"/>
          <asp:boundfield datafield="Country"
            headertext="Country"/>
        </columns>
        
      </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]"
        updatecommand="Update Customers Set CompanyName=@CompanyName, Address=@Address,
 City=@City, PostalCode=@PostalCode, Country=@Country Where (CustomerID = @CustomerID)"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
        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.CommandField
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CommandField メンバ
System.Web.UI.WebControls 名前空間
GridView
Columns
DetailsView
Fields
BoundField クラス
ButtonField クラス
ButtonFieldBase クラス
CheckBoxField クラス
DataControlField
HyperLinkField
TemplateField
ButtonFieldBase.ButtonType プロパティ
CancelText
DeleteImageUrl
DeleteText
EditImageUrl
EditText
InsertImageUrl
InsertText
NewImageUrl
NewText
SelectImageUrl
SelectText
ShowCancelButton
ShowDeleteButton
ShowEditButton
ShowInsertButton
ShowSelectButton
UpdateImageUrl
UpdateText
ControlStyle
FooterStyle
HeaderStyle
ItemStyle

CommandField コンストラクタ

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

CommandField クラス新しインスタンス初期化します。

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

public CommandField ()
public:
CommandField ()
public CommandField ()
public function CommandField ()
解説解説
使用例使用例

コンストラクタ使用してページCommandField フィールド列を GridView コントロール動的に追加する方法次のコード例示します

<%@ Page language="VB" AutoEventWireup="False"
 %>  

<script runat="server">

  Sub Page_Load(ByVal sender As
 Object, ByVal e As EventArgs)
 Handles Me.Load

    ' Dynamically generated field columns need to be created only 
    ' the first time the page is loaded.
    If Not IsPostBack Then
    
      ' Create a CommandField object to display a Select button
      ' for each record in the GridView control.
      Dim selectCommandField As New
 CommandField()
      selectCommandField.ShowSelectButton = True
      selectCommandField.SelectText = "Select Company"
      
      ' Create a BoundField object to display the company names.
      Dim lastNameBoundField As New
 BoundField()
      lastNameBoundField.DataField = "au_lname"
      lastNameBoundField.HeaderText = "Last Name"

      ' Create a BoundField object to display a customer's company name.
      Dim nameBoundField As New
 BoundField()
      nameBoundField.DataField = "CompanyName"
      nameBoundField.HeaderText = "Company Name"

      ' Create a BoundField object to display a customer's city.
      Dim cityBoundField As New
 BoundField()
      cityBoundField.DataField = "City"
      cityBoundField.HeaderText = "City"

      ' Add the field columns to the ColumnFields collection of the
      ' GridView control.
      CustomersGridView.Columns.Add(selectCommandField)
      CustomersGridView.Columns.Add(nameBoundField)
      CustomersGridView.Columns.Add(cityBoundField)
      
    End If
      
  End Sub

  Sub CustomersGridView_SelectedIndexChanged(ByVal
 sender As Object, ByVal
 e As EventArgs) Handles CustomersGridView.SelectedIndexChanged
    
    ' Get the value of the company name and city from the appropriate
 cells.
    Dim companyName As String
 = CustomersGridView.SelectedRow.Cells(1).Text
    Dim city As String =
 CustomersGridView.SelectedRow.Cells(2).Text
   
    Message.Text = "You selected " & companyName
 & " located in " & city & "."
    
  End Sub

</script>

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

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

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="False"
        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], [City]
 From [Customers]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

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

<script runat="server">

  void Page_Load(Object sender, EventArgs e)
  {
    // Dynamically generated field columns need to be created only 
    // the first time the page is loaded.
    if (!IsPostBack)
    {
      // Create a CommandField object to display a Select button
      // for each record in the GridView control.
      CommandField selectCommandField = new CommandField();
      selectCommandField.ShowSelectButton = true;
      selectCommandField.SelectText = "Select Company"; 
      
      // Create a BoundField object to display the company names.
      BoundField lastNameBoundField = new BoundField();
      lastNameBoundField.DataField = "au_lname";
      lastNameBoundField.HeaderText = "Last Name";

      // Create a BoundField object to display a customer's company
 name.
      BoundField nameBoundField = new BoundField();
      nameBoundField.DataField = "CompanyName";
      nameBoundField.HeaderText = "Company Name";

      // Create a BoundField object to display a customer's city.
      BoundField cityBoundField = new BoundField();
      cityBoundField.DataField = "City";
      cityBoundField.HeaderText = "City";

      // Add the field columns to the ColumnFields collection of the
      // GridView control.
      CustomersGridView.Columns.Add(selectCommandField);
      CustomersGridView.Columns.Add(nameBoundField);
      CustomersGridView.Columns.Add(cityBoundField);
    }
  }

  void CustomersGridView_SelectedIndexChanged(Object sender, EventArgs
 e)
  {
    // Get the value of the company name and city from the appropriate
 cells.
    String companyName = CustomersGridView.SelectedRow.Cells[1].Text;
    String city = CustomersGridView.SelectedRow.Cells[2].Text;
   
    Message.Text = "You selected " + companyName + " located in
 " + city + ".";
  }

</script>

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

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

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSqlDataSource" 
        autogeneratecolumns="False"
        onselectedindexchanged="CustomersGridView_SelectedIndexChanged"
 
        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], [City] From [Customers]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

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

CommandField プロパティ


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

( プロテクト プロパティ参照)
  名前 説明
パブリック プロパティ AccessibleHeaderText  一部コントロールAbbreviatedText プロパティ値として表示されるテキスト取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ ButtonType  ボタン フィールド表示するボタンの種類取得または設定します。 ( ButtonFieldBase から継承されます。)
パブリック プロパティ CancelImageUrl CommandField フィールドCancel ボタン表示するイメージURL取得または設定します
パブリック プロパティ CancelText CommandField フィールド表示される Cancel ボタンキャプション取得または設定します
パブリック プロパティ CausesValidation ユーザーCommandField フィールドボタンクリックしたときに検証実行されるかどうかを示す値を取得または設定します
パブリック プロパティ ControlStyle  DataControlField オブジェクト格納されているすべての Web サーバー コントロールスタイル取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ DeleteImageUrl CommandField フィールドDelete ボタン表示するイメージURL取得または設定します
パブリック プロパティ DeleteText CommandField フィールドDelete ボタンキャプション取得または設定します
パブリック プロパティ EditImageUrl CommandField フィールドEdit ボタン表示するイメージURL取得または設定します
パブリック プロパティ EditText CommandField フィールドEdit ボタンキャプション取得または設定します
パブリック プロパティ FooterStyle  データ コントロール フィールドフッタースタイル取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ FooterText  データ コントロール フィールドフッター項目に表示されるテキスト取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ HeaderImageUrl  データ コントロール フィールドヘッダー項目に表示されるイメージURL取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ HeaderStyle  データ コントロール フィールドヘッダースタイル取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ HeaderText  データ コントロール フィールドヘッダー項目に表示されるテキスト取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ InsertImageUrl CommandField フィールドInsert ボタン表示するイメージURL取得または設定します
パブリック プロパティ InsertText CommandField フィールドInsert ボタンキャプション取得または設定します
パブリック プロパティ InsertVisible  DataControlField オブジェクトの親データ バインド コントロール挿入モード場合に、このオブジェクト表示されるかどうかを示す値を取得します。 ( DataControlField から継承されます。)
パブリック プロパティ ItemStyle  データ コントロール フィールド表示されるテキスト ベース内容スタイル取得します。 ( DataControlField から継承されます。)
パブリック プロパティ NewImageUrl CommandField フィールドNew ボタン表示するイメージURL取得または設定します
パブリック プロパティ NewText CommandField フィールドNew ボタンキャプション取得または設定します
パブリック プロパティ SelectImageUrl CommandField フィールドSelect ボタン表示するイメージURL取得または設定します
パブリック プロパティ SelectText CommandField フィールドSelect ボタンキャプション取得または設定します
パブリック プロパティ ShowCancelButton CommandField フィールドCancel ボタン表示されるかどうかを示す値を取得または設定します
パブリック プロパティ ShowDeleteButton CommandField フィールドDelete ボタン表示されるかどうかを示す値を取得または設定します
パブリック プロパティ ShowEditButton CommandField フィールドEdit ボタン表示されるかどうかを示す値を取得または設定します
パブリック プロパティ ShowHeader  ButtonFieldBase オブジェクトヘッダー セクション表示するかどうかを示す値を取得または設定します。 ( ButtonFieldBase から継承されます。)
パブリック プロパティ ShowInsertButton CommandField フィールドNew ボタン表示されるかどうかを示す値を取得または設定します
パブリック プロパティ ShowSelectButton CommandField フィールドSelect ボタン表示されるかどうかを示す値を取得または設定します
パブリック プロパティ SortExpression  データ ソース コントロールデータ並べ替えるために使用される並べ替え式を、取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ UpdateImageUrl CommandField フィールドUpdate ボタン表示するイメージURL取得または設定します
パブリック プロパティ UpdateText CommandField フィールドUpdate ボタンキャプション取得または設定します
パブリック プロパティ ValidationGroup  ButtonFieldBase オブジェクトボタンクリックされたときに検証する検証コントロールグループの名前を取得または設定します。 ( ButtonFieldBase から継承されます。)
パブリック プロパティ Visible  データ コントロール フィールド表示するかどうかを示す値を取得または設定します。 ( DataControlField から継承されます。)
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ Control  DataControlField オブジェクト関連付けられているデータ コントロール参照取得します。 ( DataControlField から継承されます。)
プロテクト プロパティ DesignMode  デザイン環境で、現在データ コントロール フィールド表示されているかどうかを示す値を取得します。 ( DataControlField から継承されます。)
プロテクト プロパティ IsTrackingViewState  DataControlField オブジェクトビューステートへの変更保存しているかどうかを示す値を取得します。 ( DataControlField から継承されます。)
プロテクト プロパティ ViewState  同一ページ対す複数要求わたってDataControlField オブジェクトビューステート保存し復元できるようにする状態情報のディクショナリを取得します。 ( DataControlField から継承されます。)
参照参照

関連項目

CommandField クラス
System.Web.UI.WebControls 名前空間
GridView
Columns
DetailsView
Fields
BoundField クラス
ButtonField クラス
ButtonFieldBase クラス
CheckBoxField クラス
DataControlField
HyperLinkField
TemplateField
ButtonFieldBase.ButtonType プロパティ
CancelText
DeleteImageUrl
DeleteText
EditImageUrl
EditText
InsertImageUrl
InsertText
NewImageUrl
NewText
SelectImageUrl
SelectText
ShowCancelButton
ShowDeleteButton
ShowEditButton
ShowInsertButton
ShowSelectButton
UpdateImageUrl
UpdateText
ControlStyle
FooterStyle
HeaderStyle
ItemStyle

CommandField メソッド


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

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

関連項目

CommandField クラス
System.Web.UI.WebControls 名前空間
GridView
Columns
DetailsView
Fields
BoundField クラス
ButtonField クラス
ButtonFieldBase クラス
CheckBoxField クラス
DataControlField
HyperLinkField
TemplateField
ButtonFieldBase.ButtonType プロパティ
CancelText
DeleteImageUrl
DeleteText
EditImageUrl
EditText
InsertImageUrl
InsertText
NewImageUrl
NewText
SelectImageUrl
SelectText
ShowCancelButton
ShowDeleteButton
ShowEditButton
ShowInsertButton
ShowSelectButton
UpdateImageUrl
UpdateText
ControlStyle
FooterStyle
HeaderStyle
ItemStyle

CommandField メンバ

データ バインド コントロール選択編集挿入、または削除の各操作実行するコマンド ボタン表示する特殊なフィールド表します

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


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド CommandField CommandField クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
( プロテクト プロパティ参照)
  名前 説明
パブリック プロパティ AccessibleHeaderText  一部コントロールAbbreviatedText プロパティ値として表示されるテキスト取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ ButtonType  ボタン フィールド表示するボタンの種類取得または設定します。(ButtonFieldBase から継承されます。)
パブリック プロパティ CancelImageUrl CommandField フィールドCancel ボタン表示するイメージURL取得または設定します
パブリック プロパティ CancelText CommandField フィールド表示される Cancel ボタンキャプション取得または設定します
パブリック プロパティ CausesValidation ユーザーCommandField フィールドボタンクリックしたときに検証実行されるかどうかを示す値を取得または設定します
パブリック プロパティ ControlStyle  DataControlField オブジェクト格納されているすべての Web サーバー コントロールスタイル取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ DeleteImageUrl CommandField フィールドDelete ボタン表示するイメージURL取得または設定します
パブリック プロパティ DeleteText CommandField フィールドDelete ボタンキャプション取得または設定します
パブリック プロパティ EditImageUrl CommandField フィールドEdit ボタン表示するイメージURL取得または設定します
パブリック プロパティ EditText CommandField フィールドEdit ボタンキャプション取得または設定します
パブリック プロパティ FooterStyle  データ コントロール フィールドフッタースタイル取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ FooterText  データ コントロール フィールドフッター項目に表示されるテキスト取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ HeaderImageUrl  データ コントロール フィールドヘッダー項目に表示されるイメージURL取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ HeaderStyle  データ コントロール フィールドヘッダースタイル取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ HeaderText  データ コントロール フィールドヘッダー項目に表示されるテキスト取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ InsertImageUrl CommandField フィールドInsert ボタン表示するイメージURL取得または設定します
パブリック プロパティ InsertText CommandField フィールドInsert ボタンキャプション取得または設定します
パブリック プロパティ InsertVisible  DataControlField オブジェクトの親データ バインド コントロール挿入モード場合に、このオブジェクト表示されるかどうかを示す値を取得します。(DataControlField から継承されます。)
パブリック プロパティ ItemStyle  データ コントロール フィールド表示されるテキスト ベース内容スタイル取得します。(DataControlField から継承されます。)
パブリック プロパティ NewImageUrl CommandField フィールドNew ボタン表示するイメージURL取得または設定します
パブリック プロパティ NewText CommandField フィールドNew ボタンキャプション取得または設定します
パブリック プロパティ SelectImageUrl CommandField フィールドSelect ボタン表示するイメージURL取得または設定します
パブリック プロパティ SelectText CommandField フィールドSelect ボタンキャプション取得または設定します
パブリック プロパティ ShowCancelButton CommandField フィールドCancel ボタン表示されるかどうかを示す値を取得または設定します
パブリック プロパティ ShowDeleteButton CommandField フィールドDelete ボタン表示されるかどうかを示す値を取得または設定します
パブリック プロパティ ShowEditButton CommandField フィールドEdit ボタン表示されるかどうかを示す値を取得または設定します
パブリック プロパティ ShowHeader  ButtonFieldBase オブジェクトヘッダー セクション表示するかどうかを示す値を取得または設定します。(ButtonFieldBase から継承されます。)
パブリック プロパティ ShowInsertButton CommandField フィールドNew ボタン表示されるかどうかを示す値を取得または設定します
パブリック プロパティ ShowSelectButton CommandField フィールドSelect ボタン表示されるかどうかを示す値を取得または設定します
パブリック プロパティ SortExpression  データ ソース コントロールデータ並べ替えるために使用される並べ替え式を、取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ UpdateImageUrl CommandField フィールドUpdate ボタン表示するイメージURL取得または設定します
パブリック プロパティ UpdateText CommandField フィールドUpdate ボタンキャプション取得または設定します
パブリック プロパティ 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  データ コントロール フィールドインスタンス基本的な初期化実行します。 (DataControlField から継承されます。)
パブリック メソッド InitializeCell オーバーライドされます指定の DataControlFieldCell オブジェクト指定の行の状態に初期化します。
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  この DataControlField オブジェクトを表す文字列を返します。 (DataControlField から継承されます。)
パブリック メソッド ValidateSupportsCallback オーバーライドされますCommandField オブジェクト格納されているコントロールコールバックサポートしているかどうか確認します
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド CloneField  現在の DataControlField 派生オブジェクトコピー作成します。 (DataControlField から継承されます。)
プロテクト メソッド CopyProperties オーバーライドされます現在の CommandField オブジェクトプロパティを、指定した DataControlField オブジェクトコピーします
プロテクト メソッド CreateField オーバーライドされます。 空の CommandField オブジェクト作成します
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 (Object から継承されます。)
プロテクト メソッド LoadViewState  データ ソース ビューの、以前保存したビューステート復元します。 (DataControlField から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 (Object から継承されます。)
プロテクト メソッド OnFieldChanged  FieldChanged イベント発生させます。 (DataControlField から継承されます。)
プロテクト メソッド SaveViewState  ページサーバーポストバックされた時間以降発生したDataControlField ビューステートへの変更保存します。 (DataControlField から継承されます。)
プロテクト メソッド TrackViewState  DataControlField オブジェクトがそのビューステート変更追跡するようにします。それにより、変更コントロールViewState プロパティ格納して、同じページ対す複数要求わたって永続化できます。 (DataControlField から継承されます。)
参照参照

関連項目

CommandField クラス
System.Web.UI.WebControls 名前空間
GridView
Columns
DetailsView
Fields
BoundField クラス
ButtonField クラス
ButtonFieldBase クラス
CheckBoxField クラス
DataControlField
HyperLinkField
TemplateField
ButtonFieldBase.ButtonType プロパティ
CancelText
DeleteImageUrl
DeleteText
EditImageUrl
EditText
InsertImageUrl
InsertText
NewImageUrl
NewText
SelectImageUrl
SelectText
ShowCancelButton
ShowDeleteButton
ShowEditButton
ShowInsertButton
ShowSelectButton
UpdateImageUrl
UpdateText
ControlStyle
FooterStyle
HeaderStyle
ItemStyle


このページでは「.NET Framework クラス ライブラリ リファレンス」からCommandFieldを検索した結果を表示しています。
Weblioに収録されているすべての辞書からCommandFieldを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からCommandField を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CommandField」の関連用語

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

   

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



CommandFieldのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS