System.Web.UI.WebControls.DetailsView.ChangeMode Method

Switches the System.Web.UI.WebControls.DetailsView control to the specified mode.

Syntax

public void ChangeMode (DetailsViewMode newMode)

Parameters

newMode
One of the System.Web.UI.WebControls.DetailsViewMode values.

Remarks

Use the DetailsView.ChangeMode(DetailsViewMode) method to programmatically switch the System.Web.UI.WebControls.DetailsView control between edit, insert, and read-only mode. This method also updates the DetailsView.CurrentMode property with the specified mode. The following table lists the different mode values.

DetailsViewMode.Edit

The System.Web.UI.WebControls.DetailsView control is in edit mode, which allows the user to update the values of a record.

DetailsViewMode.Insert

The System.Web.UI.WebControls.DetailsView control is in insert mode, which allows the user to add a new record to the data source.

DetailsView.ReadOnly

The System.Web.UI.WebControls.DetailsView control is in read-only mode, which is the normal display mode.

Requirements

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