Documentation for this section has not yet been entered.
The System.Web.UI.WebControls.FormView control renders a different template for the data row based on the current mode of the control (specified by the FormView.CurrentMode property). The following table shows which template is used for each mode.
Edit | |
Insert | |
Read-only |
Use the FormView.InsertItemTemplate property to define your own user interface (UI) for the data row when the System.Web.UI.WebControls.FormView control is in insert mode. The insert item template usually contains the input controls for the user to enter the values for the new record, as well as command buttons to insert the record and to cancel the insert operation.
To specify the custom template, first place <InsertItemTemplate> tags between the opening and closing tags of the System.Web.UI.WebControls.FormView control. You can then list the contents of the template between the opening and closing <InsertItemTemplate> tags. By using a two-way binding expression, you can associate a field with an input control. When a record is inserted, the System.Web.UI.WebControls.FormView control automatically extracts the field value from the associated input control. For more information on two-way binding expressions, see ASP.NET Data Binding. To create command buttons that perform the built-in cancel and insert operations, add a command button control to the template with its CommandName property set to one of the values listed in the following table.
Cancel |
"Cancel" |
Insert |
"Insert" |
You can control the appearance of the item template by using the FormView.InsertRowStyle property.