System.Web.UI.WebControls Namespace CommandField Class
.NET Framework version 2.0
Sets or retrieves a value indicating whether a Cancel button is displayed in a CommandField.
Inline |
<asp:commandfield showcancelbutton = true | false ... > |
Script |
CommandField.ShowCancelButton [ = true | false ] |
This property accepts or returns only a boolean value: true to display a Cancel button in a CommandField; otherwise, false. Default value is true.
Use the ShowCancelButton property to specify whether a Cancel button is displayed for each data row in a CommandField control when in edit or insert mode.
NOTE: A Cancel button is shown by default in either insert or edit mode, unless otherwise specified.
Clicking the Cancel button for a row cancels the edit or insert operation and returns the record to its normal display mode.
When the ButtonType property of a CommandField is set to Button or Link, use the CancelText property to specify the text to display for a Cancel button.
Alternatively, you can display an image by first setting the ButtonType property to Image and then setting the CancelImageUrl property.
The following example shows how to set up a CommandField in a DetailsView control to display a Cancel image button when in insert or edit mode.
Show me
CommandField Members ShowDeleteButton ShowEditButton ShowInsertButton ShowSelectButton