System.Web 2.0.0.0 System.Web.UI.WebControls.ButtonFieldBase

The class is a special field used by data-bound controls (such as and ) 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.

Property

Description

Shows or hides a Delete button in a field for each record in the data-bound control. The Delete button allows the user to delete a record from the data source.

Shows or hides an Edit button in a 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.

Shows or hides the New button in a 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.

This property applies only to data-bound controls that support inserting operations, such as the control.

Shows or hides a Select button in a field for each record in the data-bound control. The Select button allows the user to select a record in the data-bound control.

In addition, the Cancel button displayed when a record is in edit or insert mode can be shown or hidden by setting the property.

When a data-bound control is used in combination with a data source control (such as a 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.

The field is displayed differently depending on the data-bound control in which it is used. For example, the control displays a field as a column, while the control displays it as a row.

To specify the type of button to display, use the property. When the 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.

Property

Description

The caption for the Cancel button.

The caption for the Delete button.

The caption for the Edit button.

The caption for the Insert button.

This property applies only to data-bound controls that support insert operations, such as the control.

The caption for the New button.

This property applies only to data-bound controls that support insert operations, such as the control.

The caption for the Select button.

The caption for the Update button.

Instead of displaying a command button or a link button, you can display an image button by setting the property to ButtonType.Image and then setting the properties shown in the following table.

Property

Description

The image to display for the Cancel button

The image to display for the Delete button.

The image to display for the Edit button.

The image to display for the Insert button.

This property applies only to data-bound controls that support insert operations, such as the control.

The image to display for the New button.

This property applies only to data-bound controls that support insert operations, such as the control.

The image to display for the Select button.

The image to display for the Update button.

By default, when the user clicks a button in a field, validation is performed on all validation controls on the page. To prevent validation from occurring when a button is clicked, set the property to false.

You can hide a field in a data-bound control by setting the property to false.

The field allows you to customize its header and footer sections. To display a caption in the header or the footer section, set the or the property, respectively. Instead of displaying text in the header section, you can display an image by setting the property. To hide the header section in a object, set the property to false.

Some data-bound controls (such as the control) can show or hide only the entire header section of the control. These data-bound controls do not support the property for an individual button field. To show or hide the entire header section of a data-bound control (if available), use the control's ShowHeader property.

You also can customize the appearance of the 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 property

Description

The style settings for the child Web server controls of the object.

The style settings for the footer section of the object.

The style settings for the header section of the object.

The style settings for the data items in the object.

Represents a special field that displays command buttons to perform selecting, editing, inserting, or deleting operations in a data-bound control.

- Constructor

  Use this constructor to initialize a new instance of the class. This constructor is commonly used when adding fields to a dynamically created data-bound control.

  To dynamically add a field to a data-bound control, create a new object, set its properties, and then add it to the data-bound control's field collection. For example, if you are using the control, add the object to the collection.

  Although you can dynamically add fields to a data-bound control, it is strongly recommended that fields be statically declared and then shown or hidden, as appropriate. Statically declaring all your fields reduces the size of the view state for the parent data-bound control.

  Initializes a new instance of the class.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue("")
  System.Web.UI.UrlProperty
  System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.String To be added.

  When the property of a field is set to ButtonType.Image, use the property to specify the image to display for the Cancel button. This image can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client's browser supports that format.

  As an alternative to displaying an image for the Cancel button, you can display text by first setting the property to ButtonType.Button or ButtonType.Link and then setting the property.

  Gets or sets the URL to an image to display for the Cancel button in a field.

  2.0.0.0
- Property
  System.ComponentModel.Localizable(true)
  System.String To be added.

  When the property of a field is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display for the Cancel button.

  As an alternative to displaying text for a Cancel button, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.

  Gets or sets the caption for the Cancel button displayed in a field.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(true)
  System.Boolean To be added.

  Use the property to specify whether validation is performed when a button in a field is clicked. When this property is set to true, by default all validation controls on the page are validated. To limit validation to only a certain group of validation controls, create a validation group and then set the property to the validation group's name. For more information on validation groups, see .

  Gets or sets a value indicating whether validation is performed when the user clicks a button in a field.

  2.0.0.0
- Method
  System.Void ``

  The method is a helper method used by the method to copy the properties of the current object to the object created by the method.

  Copies the properties of the current object to the specified object.

  The to copy the properties of the current to. 2.0.0.0
- Method
  System.Web.UI.WebControls.DataControlField

  The method is a helper method used by the method to create an empty object to copy the properties of the current object to.

  Creates an empty object.

  An empty .

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue("")
  System.Web.UI.UrlProperty
  System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.String To be added.

  When the property of a field is set to ButtonType.Image, use the property to specify the image to display for a Delete button. This image can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client's browser supports that format.

  As an alternative to displaying an image for a Delete button, you can display text by first setting the property to ButtonType.Button or ButtonType.Link and then setting the property.

  Gets or sets the URL to an image to display for a Delete button in a field.

  2.0.0.0
- Property
  System.ComponentModel.Localizable(true)
  System.String To be added.

  When the property of a field is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display for a Delete button.

  As an alternative to displaying text for a Delete button, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.

  Gets or sets the caption for a Delete button in a field.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue("")
  System.Web.UI.UrlProperty
  System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.String To be added.

  When the property of a field is set to ButtonType.Image, use the property to specify the image to display for an Edit button. This image can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client's browser supports that format.

  As an alternative to displaying an image for an Edit button, you can display text by first setting the property to ButtonType.Button or ButtonType.Link and then setting the property.

  Gets or sets the URL to an image to display for an Edit button in a field.

  2.0.0.0
- Property
  System.ComponentModel.Localizable(true)
  System.String To be added.

  When the property of a object is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display for an Edit button.

  As an alternative to displaying text for an Edit button, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.

  Gets or sets the caption for an Edit button in a field.

  2.0.0.0
- Method
  System.Void `` `` `` ``

  The method is implemented by -derived types to add text and controls to a object of a data control that uses tables to display a user interface (UI). These data controls create the complete table structure row-by-row when the control's CreateChildControls method is called. The method is called by the InitializeRow method of data controls such as and .

  Call this method when you are writing a custom data-bound control that uses objects to initialize the cells of the table structure with data or controls. Implement this method when you are writing a -derived class.

  Initializes the specified object to the specified row state.

  The to initialize. One of the values. One of the values. The zero-based index of the row that contains the cell. 2.0.0.0
- Property
  System.ComponentModel.DefaultValue("")
  System.Web.UI.UrlProperty
  System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.String To be added.

  When the property of a field is set to ButtonType.Image, use the property to specify the image to display for an Insert button. This image can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client's browser supports that format.

  As an alternative to displaying an image for the Insert button, you can display text by first setting the property to ButtonType.Button or ButtonType.Link and then setting the property.

  Gets or sets the URL to an image to display for the Insert button in a field.

  2.0.0.0
- Property
  System.ComponentModel.Localizable(true)
  System.String To be added.

  When the property of a field is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display for the Insert button.

  As an alternative to displaying text for the Insert button, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.

  Gets or sets the caption for the Insert button in a field.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue("")
  System.Web.UI.UrlProperty
  System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.String To be added.

  When the property of a field is set to ButtonType.Image, use the property to specify the image to display for the New button. This image can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client's browser supports that format.

  As an alternative to displaying an image for the New button, you can display text by first setting the property to ButtonType.Button or ButtonType.Link and then setting the property.

  Gets or sets the URL to an image to display for the New button in a field.

  2.0.0.0
- Property
  System.ComponentModel.Localizable(true)
  System.String To be added.

  When the property of a object is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display for the New button.

  As an alternative to displaying text for the New button, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.

  Gets or sets the caption for the New button in a field.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue("")
  System.Web.UI.UrlProperty
  System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.String To be added.

  When the property of a field is set to ButtonType.Image, use the property to specify the image to display for a Select button. This image can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client's browser supports that format.

  As an alternative to displaying an image for a Select button, you can display text by first setting the property to ButtonType.Button or ButtonType.Link and then setting the property.

  Gets or sets the URL to an image to display for a Select button in a field.

  2.0.0.0
- Property
  System.ComponentModel.Localizable(true)
  System.String To be added.

  When the property of a field is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display for a Select button.

  As an alternative to displaying text for a Select button, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.

  Gets or sets the caption for a Select button in a field.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(true)
  System.Boolean To be added.

  Use the property to specify whether the Cancel button is displayed in a object. A Cancel button can be displayed in a field when the corresponding record in a data-bound control is in edit or insert mode. The Cancel button allows the user to cancel the edit or insert operation and returns the record to its normal display mode.

  When the property of a field is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display for a Cancel button. Alternatively, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  Gets or sets a value indicating whether a Cancel button is displayed in a field.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(false)
  System.Boolean To be added.

  Use the property to specify whether a Delete button is displayed in a field for each record in the data-source control. The Delete button allows you to remove a record from the data source.

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

  When the property of a field is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display for a Delete button. Alternatively, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  Gets or sets a value indicating whether a Delete button is displayed in a field.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(false)
  System.Boolean To be added.

  Use the property to specify whether an Edit button is displayed in the 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.

  When a data-bound control is used in combination with a data source control (such as a 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 property of a field is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display for an Edit button. Alternatively, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  Gets or sets a value indicating whether an Edit button is displayed in a field.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(false)
  System.Boolean To be added.

  Use the property to specify whether a New button is displayed in a field. The New button is displayed only once in the field and allows the user to add a new record in the data source.

  This property applies only to data-bound controls that support insert operations, such as the control.

  When the user clicks the New button, input controls are displayed for each field displayed in the data-bound control, allowing the user to enter the values for the new record. The New button is replaced with an Insert button and a Cancel button, and all other command buttons in the field are hidden. Clicking the Insert button adds the record to the data source, whereas clicking the Cancel button cancels the operation.

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

  When the property of a field is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display for a New button. Alternatively, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  Gets or sets a value indicating whether a New button is displayed in a field.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue(false)
  System.Boolean To be added.

  Use the property to specify whether a Select button is displayed in a field for each record in the data-source control. The Select button allows the user to select a row in the data-source control. When the Select button for a record is clicked, the data-source control responds accordingly. For example, a control updates the , , , and properties to values corresponding to the selected row. The style is then applied to the selected row and the and events are raised.

  When the property of a field is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display for a Select button. Alternatively, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  Gets or sets a value indicating whether a Select button is displayed in a field.

  2.0.0.0
- Property
  System.ComponentModel.DefaultValue("")
  System.Web.UI.UrlProperty
  System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
  System.String To be added.

  When the property of a field is set to ButtonType.Image, use the property to specify the image to display for an Update button. This image can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client's browser supports that format.

  As an alternative to displaying an image for an Update button, you can display text by first setting the property to ButtonType.Button or ButtonType.Link and then setting the property.

  Gets or sets the URL to an image to display for an Update button in a field.

  2.0.0.0
- Property
  System.ComponentModel.Localizable(true)
  System.String To be added.

  When the property of a field is set to ButtonType.Button or ButtonType.Link, use the property to specify the text to display in an Update button.

  As an alternative to displaying text for an Update button, you can display an image by first setting the property to ButtonType.Image and then setting the property.

  The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.

  Gets or sets the caption for an Update button in a field.

  2.0.0.0
- Method
  System.Void

  The method is a helper method used to determine whether the controls contained in a object support callbacks. The class does not support callbacks when the Select button is displayed. This method has been implemented to throw a exception when the Select button is displayed.

  This method is used primarily by control developers.

  Determines whether the controls contained in a object support callbacks.

  2.0.0.0