Switches the System.Web.UI.WebControls.FormView control to the specified data-entry mode.
- newMode
- One of the System.Web.UI.WebControls.FormViewMode enumeration values.
Use the FormView.ChangeMode(FormViewMode) method to programmatically switch the System.Web.UI.WebControls.FormView control between edit, insert, and read-only modes. This method also updates the FormView.CurrentMode property with the specified mode. The following table lists the different mode values.
FormViewMode.Edit |
The System.Web.UI.WebControls.FormView control is in edit mode, which allows the user to update the values of a record. |
FormViewMode.Insert |
The System.Web.UI.WebControls.FormView control is in insert mode, which allows the user to add a new record to the data source. |
FormView.ReadOnly |
The System.Web.UI.WebControls.FormView control is in read-only mode, which is the normal display mode. |
The FormView.ModeChanged and FormView.ModeChanging events are not raised when this method is called.