System.Web.UI.WebControls.FormView.CurrentMode Property

Gets the current data-entry mode of the System.Web.UI.WebControls.FormView control.

Syntax

[System.ComponentModel.Browsable(false)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public FormViewMode CurrentMode { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the FormView.CurrentMode property to determine whether the System.Web.UI.WebControls.FormView control is in edit, insert, or read-only 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.

This value is normally set automatically by the System.Web.UI.WebControls.FormView control when the New, Update, Insert, Delete, or Cancel command button is clicked. When the System.Web.UI.WebControls.FormView control changes modes in response to an action, the events in the following table are raised. This allows you to create a custom event handler that performs the appropriate routine when the event occurs.

FormView.ModeChanged

Occurs when the System.Web.UI.WebControls.FormView control changes modes, but after the mode changes. This event is commonly used to perform a task whenever the System.Web.UI.WebControls.FormView control changes modes.

FormView.ModeChanging

Occurs when the System.Web.UI.WebControls.FormView control changes modes, but before the mode changes. This event is commonly used to cancel the mode change.

Note   These events are not raised when you change the mode programmatically by using the FormView.ChangeMode(FormViewMode) method.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0