CommandField クラス
アセンブリ: System.Web (system.web.dll 内)


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 ボタンを表示または非表示にすることもできます。
![]() |
---|
データ バインド コントロールをデータ ソース コントロール (SqlDataSource コントロールなど) と組み合わせて使用すると、データ バインド コントロールはデータ ソース コントロールの機能を利用して、削除、更新、および挿入の自動実行機能を提供できます。その他のデータ ソースの場合、データ バインド コントロールの適切なイベント中にこれらの操作を実行するためにルーチンを提供する必要があります。 |
CommandField フィールドは、それが使用されているデータ バインド コントロールによって表示が異なります。たとえば、CommandField フィールドは、GridView コントロールでは列として表示され、DetailsView コントロールでは行として表示されます。
表示するボタンの種類を指定するには、ButtonType プロパティを使用します。ButtonType プロパティが ButtonType.Button または ButtonType.Link に設定されている場合、次の表に示すプロパティを設定して、ボタンに表示するテキストを指定できます。
CancelText | |
DeleteText | |
EditText | |
InsertText | |
NewText | |
SelectText | |
UpdateText |
コマンド ボタンまたはリンク ボタンを表示する代わりに、ButtonType プロパティを ButtonType.Image に設定し、次の表に示すプロパティを設定して、イメージ ボタンを表示できます。
CancelImageUrl | |
DeleteImageUrl | |
EditImageUrl | |
InsertText | |
NewImageUrl | |
SelectImageUrl | |
UpdateImageUrl |
既定では、ユーザーが CommandField フィールドでボタンをクリックすると、ページのすべての検証コントロールで検証が実行されます。ボタンをクリックしたときに検証が行われないようにするには、CausesValidation プロパティを false に設定します。
Visible プロパティを false に設定すると、データ バインド コントロールの CommandField フィールドを非表示にできます。
CommandField フィールドを使用すると、ヘッダー セクションおよびフッター セクションをカスタマイズできます。ヘッダー セクションまたはフッター セクションにキャプションを表示するには、HeaderText プロパティまたは FooterText プロパティをそれぞれ設定します。ヘッダー セクションにテキストを表示する代わりに、HeaderImageUrl プロパティを設定してイメージを表示できます。CommandField オブジェクトのヘッダー セクションを非表示にするには、ShowHeader プロパティを false に設定します。
![]() |
---|
一部のデータ バインド コントロール (GridView コントロールなど) では、コントロールのヘッダー セクション全体を表示または非表示にできます。これらのデータ バインド コントロールは、個別のボタン フィールドの ShowHeader プロパティをサポートしていません。データ バインド コントロールのヘッダー セクション (存在する場合) 全体を表示または非表示にするには、コントロールの ShowHeader プロパティを使用します。 |
フィールドの各部分にスタイル プロパティを設定することにより、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>
CancelText、EditText、および 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>


System.Web.UI.WebControls.DataControlField
System.Web.UI.WebControls.ButtonFieldBase
System.Web.UI.WebControls.CommandField


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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 コンストラクタ
アセンブリ: System.Web (system.web.dll 内)


このコンストラクタを使用して、CommandField クラスの新しいインスタンスを初期化します。通常、このコンストラクタは、動的に作成されたデータ バインド コントロールにフィールドを追加する場合に使用されます。
CommandField フィールドをデータ バインド コントロールに動的に追加するには、新しい CommandField オブジェクトを作成してそのプロパティを設定し、データ バインド コントロールのフィールド コレクションに追加します。たとえば、GridView コントロールを使用する場合は、CommandField オブジェクトを Columns コレクションに追加します。
![]() |
---|
フィールドはデータ バインド コントロールに動的に追加することもできますが、フィールドを静的に宣言しておき、適宜、表示または非表示にすることをお勧めします。すべてのフィールドを静的に宣言すると、親データ バインド コントロールのビューステートのサイズが小さくなります。 |

コンストラクタを使用して、ページに 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>

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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 データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | 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
Weblioに収録されているすべての辞書からCommandFieldを検索する場合は、下記のリンクをクリックしてください。

- CommandFieldのページへのリンク