CommandField 类

定义

表示用于显示命令按钮的特殊字段,这些按钮可在数据绑定控件中执行选择、编辑、插入或删除操作。Represents a special field that displays command buttons to perform selecting, editing, inserting, or deleting operations in a data-bound control.

public ref class CommandField : System::Web::UI::WebControls::ButtonFieldBase
public class CommandField : System.Web.UI.WebControls.ButtonFieldBase
type CommandField = class
    inherit ButtonFieldBase
Public Class CommandField
Inherits ButtonFieldBase
继承

示例

下面的代码示例演示如何使用CommandField字段显示控件, 以便GridView在控件中编辑记录。The following code example demonstrates how to use a CommandField field to display controls to edit a record in a GridView control.


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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>CommandField Example</title>
</head>
<body>
    <form id="form1" 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="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>CommandField Example</title>
</head>
<body>
    <form id="form1" 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>

下面的代码示例演示如何使用CancelTextEditTextUpdateText属性来自定义编辑控件的文本。The following code example demonstrates how to use the CancelText, EditText, and UpdateText properties to customize the text for the editing controls.


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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>CommandField Example</title>
</head>
<body>
    <form id="form1" 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="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>CommandField Example</title>
</head>
<body>
    <form id="form1" 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>

注解

类是数据绑定控件 ( GridView如和DetailsView) 用于显示执行删除、编辑、插入或选择操作的命令按钮的特殊字段。 CommandFieldThe CommandField class is a special field used by data-bound controls (such as GridView and DetailsView) to display command buttons that perform delete, edit, insert, or select operations. 可以使用下表中显示的属性来显示或隐藏执行这些操作的命令按钮。The command buttons to perform these operations can be shown or hidden using the properties shown in the following table.

PropertyProperty 说明Description
ShowDeleteButton 显示或隐藏数据绑定控件中每CommandField个记录的字段中的 "删除" 按钮。Shows or hides a Delete button in a CommandField field for each record in the data-bound control. "删除" 按钮允许用户从数据源中删除记录。The Delete button allows the user to delete a record from the data source.
ShowEditButton 显示或隐藏数据绑定控件中每CommandField个记录的字段中的 "编辑" 按钮。Shows or hides an Edit button in a CommandField field for each record in the data-bound control. 使用 "编辑" 按钮, 用户可以编辑数据源中的记录。The Edit button allows the user to edit a record from the data source. 当用户单击特定记录的 "编辑" 按钮时, "编辑" 按钮将被 "更新" 按钮和 "取消" 按钮替换。When the user clicks the Edit button for a specific record, that Edit button is replaced with an Update button and a Cancel button. 还将隐藏其他所有命令按钮。All other command buttons are also hidden.
ShowInsertButton 显示或隐藏CommandField字段中的 "新建" 按钮。Shows or hides the New button in a CommandField field. "新建" 按钮允许用户在数据源中插入新记录。The New button allows the user to insert a new record in the data source. 当用户单击 "新建" 按钮时, 会将其替换为 "插入" 按钮和 "取消" 按钮。When the user clicks the New button, it is replaced with an Insert button and a Cancel button. 还将隐藏其他所有命令按钮。All other command buttons are also hidden. 注意: 此属性仅适用于支持插入操作 (如DetailsView控件) 的数据绑定控件。Note: This property applies only to data-bound controls that support inserting operations, such as the DetailsView control.
ShowSelectButton 显示或隐藏数据绑定控件中每CommandField个记录的字段中的 "选择" 按钮。Shows or hides a Select button in a CommandField field for each record in the data-bound control. 使用 "选择" 按钮, 用户可以在数据绑定控件中选择一条记录。The Select button allows the user to select a record in the data-bound control.

此外, 可以通过设置ShowCancelButton属性来显示或隐藏记录处于编辑或插入模式时显示的 "取消" 按钮。In addition, the Cancel button displayed when a record is in edit or insert mode can be shown or hidden by setting the ShowCancelButton property.

备注

当数据绑定控件与数据源控件 (如SqlDataSource控件) 结合使用时, 数据绑定控件可以利用数据源控件的功能, 并提供自动删除、更新和插入功能。When a data-bound control is used in combination with a data source control (such as a SqlDataSource control), the data-bound control can take advantage of the data source control's capabilities and provide automatic delete, update, and insert functionality. 对于其他数据源, 您需要提供例程以便在数据绑定控件的相应事件期间执行这些操作。For other data sources, you need to provide the routines to perform these operations during the appropriate events for the data-bound control.

CommandField字段的显示方式取决于使用它的数据绑定控件。The CommandField field is displayed differently depending on the data-bound control in which it is used. 例如, GridView控件以列的形式CommandField显示字段, 而DetailsView控件则将其显示为一行。For example, the GridView control displays a CommandField field as a column, while the DetailsView control displays it as a row.

若要指定要显示的按钮类型, 请使用ButtonType属性。To specify the type of button to display, use the ButtonType property. 如果将ButtonType.Button属性设置为或ButtonType.Link, 则可以通过设置下表中显示的属性来指定要为按钮显示的文本。 ButtonTypeWhen the ButtonType property is set to ButtonType.Button or ButtonType.Link, you can specify the text to display for the buttons by setting the properties shown in the following table.

PropertyProperty 说明Description
CancelText "取消" 按钮的标题。The caption for the Cancel button.
DeleteText "删除" 按钮的标题。The caption for the Delete button.
EditText "编辑" 按钮的标题。The caption for the Edit button.
InsertText "插入" 按钮的标题。The caption for the Insert button. 注意: 此属性仅适用于支持插入操作 (如DetailsView控件) 的数据绑定控件。Note: This property applies only to data-bound controls that support insert operations, such as the DetailsView control.
NewText "新建" 按钮的标题。The caption for the New button. 注意: 此属性仅适用于支持插入操作 (如DetailsView控件) 的数据绑定控件。Note: This property applies only to data-bound controls that support insert operations, such as the DetailsView control.
SelectText "选择" 按钮的标题。The caption for the Select button.
UpdateText "更新" 按钮的标题。The caption for the Update button.

您可以通过将ButtonType属性设置为ButtonType.Image , 然后设置下表中显示的属性, 而不是显示命令按钮或链接按钮。Instead of displaying a command button or a link button, you can display an image button by setting the ButtonType property to ButtonType.Image and then setting the properties shown in the following table.

PropertyProperty 说明Description
CancelImageUrl 为 "取消" 按钮显示的图像The image to display for the Cancel button
DeleteImageUrl 为 "删除" 按钮显示的图像。The image to display for the Delete button.
EditImageUrl 要为 "编辑" 按钮显示的图像。The image to display for the Edit button.
InsertText 要为 "插入" 按钮显示的图像。The image to display for the Insert button. 注意: 此属性仅适用于支持插入操作 (如DetailsView控件) 的数据绑定控件。Note: This property applies only to data-bound controls that support insert operations, such as the DetailsView control.
NewImageUrl 要为 "新建" 按钮显示的图像。The image to display for the New button. 注意: 此属性仅适用于支持插入操作 (如DetailsView控件) 的数据绑定控件。Note: This property applies only to data-bound controls that support insert operations, such as the DetailsView control.
SelectImageUrl 要为 "选择" 按钮显示的图像。The image to display for the Select button.
UpdateImageUrl 为 "更新" 按钮显示的图像。The image to display for the Update button.

默认情况下, 当用户单击CommandField字段中的按钮时, 将对该页上的所有验证控件执行验证。By default, when the user clicks a button in a CommandField field, validation is performed on all validation controls on the page. 若要防止在单击按钮时进行验证, 请将CausesValidation属性设置为。 falseTo prevent validation from occurring when a button is clicked, set the CausesValidation property to false.

可以通过CommandField Visible将属性设置为来false隐藏数据绑定控件中的字段。You can hide a CommandField field in a data-bound control by setting the Visible property to false.

可以CommandField通过字段自定义其页眉和页脚部分。The CommandField field allows you to customize its header and footer sections. 若要在页眉或页脚部分显示标题, 请分别设置HeaderText FooterText或属性。To display a caption in the header or the footer section, set the HeaderText or the FooterText property, respectively. 您可以通过设置HeaderImageUrl属性来显示图像, 而不是在页眉节中显示文本。Instead of displaying text in the header section, you can display an image by setting the HeaderImageUrl property. 若要隐藏CommandField对象中的标头部分, 请ShowHeader将属性false设置为。To hide the header section in a CommandField object, set the ShowHeader property to false.

备注

某些数据绑定控件 (如GridView控件) 只能显示或隐藏控件的整个标题部分。Some data-bound controls (such as the GridView control) can show or hide only the entire header section of the control. 这些数据绑定控件不支持单个按钮字段ShowHeader的属性。These data-bound controls do not support the ShowHeader property for an individual button field. 若要显示或隐藏数据绑定控件 (如果可用) 的整个标头部分, 请使用控件的ShowHeader属性。To show or hide the entire header section of a data-bound control (if available), use the control's ShowHeader property.

还可以通过设置字段的不同部分CommandField的样式属性来自定义对象 (字体颜色、背景色等) 的外观。You also can customize the appearance of the CommandField object (font color, background color, and so on) by setting the style properties for the different parts of the field. 下表列出了不同的样式属性。The following table lists the different style properties.

Style 属性Style property 说明Description
ControlStyle CommandField对象的子 Web 服务器控件的样式设置。The style settings for the child Web server controls of the CommandField object.
FooterStyle CommandField对象的脚注部分的样式设置。The style settings for the footer section of the CommandField object.
HeaderStyle CommandField对象的标头部分的样式设置。The style settings for the header section of the CommandField object.
ItemStyle CommandField对象中数据项的样式设置。The style settings for the data items in the CommandField object.

构造函数

CommandField()

初始化 CommandField 类的新实例。Initializes a new instance of the CommandField class.

属性

AccessibleHeaderText

获取或设置某些控件中呈现为 AbbreviatedText 属性值的文本。Gets or sets text that is rendered as the AbbreviatedText property value in some controls.

(继承自 DataControlField)
ButtonType

获取或设置要在按钮字段中显示的按钮类型。Gets or sets the button type to display in the button field.

(继承自 ButtonFieldBase)
CancelImageUrl

获取或设置为 CommandField 字段中的“取消”按钮显示的图像的 URL。Gets or sets the URL to an image to display for the Cancel button in a CommandField field.

CancelText

获取或设置 CommandField 字段中显示的“取消”按钮的标题。Gets or sets the caption for the Cancel button displayed in a CommandField field.

CausesValidation

获取或设置一个值,该值指示当用户单击 CommandField 字段中的按钮时是否执行验证。Gets or sets a value indicating whether validation is performed when the user clicks a button in a CommandField field.

Control

获取对数据控件的引用,该控件与 DataControlField 对象关联。Gets a reference to the data control that the DataControlField object is associated with.

(继承自 DataControlField)
ControlStyle

获取 DataControlField 对象所包含的任何 Web 服务器控件的样式。Gets the style of any Web server controls contained by the DataControlField object.

(继承自 DataControlField)
DeleteImageUrl

获取或设置为 CommandField 字段中的“删除”按钮显示的图像的 URL。Gets or sets the URL to an image to display for a Delete button in a CommandField field.

DeleteText

获取或设置 CommandField 字段中的“删除”按钮的标题。Gets or sets the caption for a Delete button in a CommandField field.

DesignMode

获取一个值,该值指示数据控件字段当前是否在设计时环境中进行查看。Gets a value indicating whether a data control field is currently viewed in a design-time environment.

(继承自 DataControlField)
EditImageUrl

获取或设置为 CommandField 字段中的“编辑”按钮显示的图像的 URL。Gets or sets the URL to an image to display for an Edit button in a CommandField field.

EditText

获取或设置 CommandField 字段中的“编辑”按钮的标题。Gets or sets the caption for an Edit button in a CommandField field.

FooterStyle

获取或设置数据控件字段脚注的样式。Gets or sets the style of the footer of the data control field.

(继承自 DataControlField)
FooterText

获取或设置数据控件字段的脚注项中显示的文本。Gets or sets the text that is displayed in the footer item of a data control field.

(继承自 DataControlField)
HeaderImageUrl

获取或设置数据控件字段的标题项中显示的图像的 URL。Gets or sets the URL of an image that is displayed in the header item of a data control field.

(继承自 DataControlField)
HeaderStyle

获取或设置数据控件字段标头的样式。Gets or sets the style of the header of the data control field.

(继承自 DataControlField)
HeaderText

获取或设置数据控件字段的标题项中显示的文本。Gets or sets the text that is displayed in the header item of a data control field.

(继承自 DataControlField)
InsertImageUrl

获取或设置为 CommandField 字段中的“插入”按钮显示的图像的 URL。Gets or sets the URL to an image to display for the Insert button in a CommandField field.

InsertText

获取或设置 CommandField 字段中的“插入”按钮的标题。Gets or sets the caption for the Insert button in a CommandField field.

InsertVisible

获取一个值,该值指示 DataControlField 对象在其父级数据绑定控件处于插入模式时是否可见。Gets a value indicating whether the DataControlField object is visible when its parent data-bound control is in insert mode.

(继承自 DataControlField)
IsTrackingViewState

获取一个值,该值指示 DataControlField 对象是否保存对其视图状态的更改。Gets a value indicating whether the DataControlField object is saving changes to its view state.

(继承自 DataControlField)
ItemStyle

获取由数据控件字段显示的任何基于文本的内容的样式。Gets the style of any text-based content displayed by a data control field.

(继承自 DataControlField)
NewImageUrl

获取或设置为 CommandField 字段中的“新建”按钮显示的图像的 URL。Gets or sets the URL to an image to display for the New button in a CommandField field.

NewText

获取或设置 CommandField 字段中的“新建”按钮的标题。Gets or sets the caption for the New button in a CommandField field.

SelectImageUrl

获取或设置为 CommandField 字段中的“选择”按钮显示的图像的 URL。Gets or sets the URL to an image to display for a Select button in a CommandField field.

SelectText

获取或设置 CommandField 字段中的“选择”按钮的标题。Gets or sets the caption for a Select button in a CommandField field.

ShowCancelButton

获取或设置一个值,该值指示是否在 CommandField 字段中显示“取消”按钮。Gets or sets a value indicating whether a Cancel button is displayed in a CommandField field.

ShowDeleteButton

获取或设置一个值,该值指示是否在 CommandField 字段中显示“删除”按钮。Gets or sets a value indicating whether a Delete button is displayed in a CommandField field.

ShowEditButton

获取或设置一个值,该值指示是否在 CommandField 字段中显示“编辑”按钮。Gets or sets a value indicating whether an Edit button is displayed in a CommandField field.

ShowHeader

获取或设置一个值,该值指示是否显示 ButtonFieldBase 对象的标头部分。Gets or sets a value indicating whether the header section is displayed in a ButtonFieldBase object.

(继承自 ButtonFieldBase)
ShowInsertButton

获取或设置一个值,该值指示是否在 CommandField 字段中显示“新建”按钮。Gets or sets a value indicating whether a New button is displayed in a CommandField field.

ShowSelectButton

获取或设置一个值,该值指示是否在 CommandField 字段中显示“选择”按钮。Gets or sets a value indicating whether a Select button is displayed in a CommandField field.

SortExpression

获取或设置数据源控件用来对数据进行排序的排序表达式。Gets or sets a sort expression that is used by a data source control to sort data.

(继承自 DataControlField)
UpdateImageUrl

获取或设置为 CommandField 字段中的“更新”按钮显示的图像的 URL。Gets or sets the URL to an image to display for an Update button in a CommandField field.

UpdateText

获取或设置 CommandField 字段中的“更新”按钮的标题。Gets or sets the caption for an Update button in a CommandField field.

ValidateRequestMode

获取或设置一个值,该值指定该控件是否验证客户端输入。Gets or sets a value that specifies whether the control validates client input.

(继承自 DataControlField)
ValidationGroup

获取或设置在单击 ButtonFieldBase 对象中的按钮时要验证的验证控件组的名称。Gets or sets the name of the group of validation controls to validate when a button in a ButtonFieldBase object is clicked.

(继承自 ButtonFieldBase)
ViewState

获取状态信息的字典,这些信息使您可以在同一页的多个请求间保存和还原 DataControlField 对象的视图状态。Gets a dictionary of state information that allows you to save and restore the view state of a DataControlField object across multiple requests for the same page.

(继承自 DataControlField)
Visible

获取或设置指示是否呈现数据控件字段的值。Gets or sets a value indicating whether a data control field is rendered.

(继承自 DataControlField)

方法

CloneField()

创建当前 DataControlField 派生对象的副本。Creates a duplicate copy of the current DataControlField-derived object.

(继承自 DataControlField)
CopyProperties(DataControlField)

将当前 CommandField 对象的属性复制到指定的 DataControlField 对象。Copies the properties of the current CommandField object to the specified DataControlField object.

CreateField()

创建一个空的 CommandField 对象。Creates an empty CommandField object.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
ExtractValuesFromCell(IOrderedDictionary, DataControlFieldCell, DataControlRowState, Boolean)

从当前表格单元格中提取数据控件字段的值,并将该值添加到指定的 IDictionary 集合中。Extracts the value of the data control field from the current table cell and adds the value to the specified IDictionary collection.

(继承自 DataControlField)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
Initialize(Boolean, Control)

为数据控件字段执行基础实例初始化。Performs basic instance initialization for a data control field.

(继承自 DataControlField)
InitializeCell(DataControlFieldCell, DataControlCellType, DataControlRowState, Int32)

将指定的 DataControlFieldCell 对象初始化为指定的行状态。Initializes the specified DataControlFieldCell object to the specified row state.

LoadViewState(Object)

将数据源视图还原为保存过的前一视图状态。Restores the data source view's previously saved view state.

(继承自 DataControlField)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
OnFieldChanged()

引发 FieldChanged 事件。Raises the FieldChanged event.

(继承自 DataControlField)
SaveViewState()

保存在页回发到服务器后对 DataControlField 视图状态所做的更改。Saves the changes made to the DataControlField view state since the time the page was posted back to the server.

(继承自 DataControlField)
ToString()

返回表示此 DataControlField 对象的字符串。Returns a string that represents this DataControlField object.

(继承自 DataControlField)
TrackViewState()

使 DataControlField 对象跟踪对其视图状态所做的更改,以便这些更改可以存储在控件的 ViewState 属性中并且能够在同一页的不同请求间得以保持。Causes the DataControlField object to track changes to its view state so they can be stored in the control's ViewState property and persisted across requests for the same page.

(继承自 DataControlField)
ValidateSupportsCallback()

确定包含在 CommandField 对象中的控件是否支持回调。Determines whether the controls contained in a CommandField object support callbacks.

显式界面实现

IDataSourceViewSchemaAccessor.DataSourceViewSchema

获取或设置与此 DataControlField 对象关联的架构。Gets or sets the schema associated with this DataControlField object.

(继承自 DataControlField)
IStateManager.IsTrackingViewState

获取一个值,该值指示 DataControlField 对象是否保存对其视图状态的更改。Gets a value indicating whether the DataControlField object is saving changes to its view state.

(继承自 DataControlField)
IStateManager.LoadViewState(Object)

将数据控件字段还原为保存过的前一视图状态。Restores the data control field's previously saved view state.

(继承自 DataControlField)
IStateManager.SaveViewState()

保存在页回发到服务器后对 DataControlField 视图状态所做的更改。Saves the changes made to the DataControlField view state since the time the page was posted back to the server.

(继承自 DataControlField)
IStateManager.TrackViewState()

使 DataControlField 对象跟踪对其视图状态所做的更改,以便这些更改可以存储在控件的 ViewState 属性中并且能够在同一页的不同请求间得以保持。Causes the DataControlField object to track changes to its view state so they can be stored in the control's ViewState property and persisted across requests for the same page.

(继承自 DataControlField)

适用于

另请参阅