System.Web.UI.WebControls.CommandField.ShowEditButton Property

Gets or sets a value indicating whether an Edit button is displayed in a System.Web.UI.WebControls.CommandField field.

Syntax

[System.ComponentModel.DefaultValue(false)]
public virtual bool ShowEditButton { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the CommandField.ShowEditButton property to specify whether an Edit button is displayed in the System.Web.UI.WebControls.CommandField field for each record in the data-source control. The Edit button allows you to edit the values of a record.

When the user clicks an Edit button, input controls are displayed for each field in the record. The Edit button for the record is replaced with an Update button and a Cancel button, and all other command buttons for the record are hidden. Clicking the Update button updates the record with the new values in the data source, whereas clicking the Cancel button cancels the operation.

Note:

When a data-bound control is used in combination with a data source control (such as a System.Web.UI.WebControls.SqlDataSource control), the data-bound control can take advantage of the data source control's capabilities and provide automatic updating functionality. For other data sources, you must provide the routines to perform the update operation during the appropriate event for the data-bound control.

When the ButtonFieldBase.ButtonType property of a System.Web.UI.WebControls.CommandField field is set to ButtonType.Button or ButtonType.Link, use the CommandField.EditText property to specify the text to display for an Edit button. Alternatively, you can display an image by first setting the ButtonFieldBase.ButtonType property to ButtonType.Image and then setting the CommandField.EditImageUrl property.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0