CommandField.ShowInsertButton Property
Assembly: System.Web (in system.web.dll)
/** @property */ public boolean get_ShowInsertButton () /** @property */ public void set_ShowInsertButton (boolean value)
public function get ShowInsertButton () : boolean public function set ShowInsertButton (value : boolean)
Property Value
true to display a New button in a CommandField; otherwise, false. The default is false.Use the ShowInsertButton property to specify whether a New button is displayed in a CommandField field. The New button is displayed only once in the CommandField field and allows the user to add a new record in the data source.
Note |
|---|
| This property applies only to data-bound controls that support insert operations, such as the DetailsView 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 CommandField field are hidden. Clicking the Insert button adds the record to 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 SqlDataSource 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 ButtonType property of a CommandField field is set to ButtonType.Button or ButtonType.Link, use the NewText property to specify the text to display for a New button. Alternatively, you can display an image by first setting the ButtonType property to ButtonType.Image and then setting the NewImageUrl property.
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
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Reference
CommandField ClassCommandField Members
System.Web.UI.WebControls Namespace
CommandField.InsertImageUrl Property
CommandField.InsertText Property
CommandField.NewImageUrl Property
CommandField.NewText Property
CommandField.ShowCancelButton Property
CommandField.ShowDeleteButton Property
CommandField.ShowEditButton Property
ShowSelectButton
Note