System.Web.UI.WebControls Namespace FormView Class
.NET Framework version 2.0
Occurs when the FormView control switches between edit, insert, and read-only mode, but before the mode changes.
[ VB ]
Public Event ModeChanging As FormViewModeEventHandler
[ C# ]
public event FormViewModeEventHandler ModeChanging;
[ C++ ]
public: __event FormViewModeEventHandler* ModeChanging;
In [ JScript ], you can handle the events defined by a class, but you cannot define your own.
The ModeChanging event is raised whenever the FormView control switches between edit, insert, and read-only mode, but before the mode actually changes.
This allows you to provide an event-handling method that performs a custom routine, such as configuring the FormView control for a specific mode or canceling the mode change, whenever this event occurs.
The method assigned to handle the event is passed an argument of type FormViewModeEventArgs object containing data related to this event. The following FormViewModeEventArgs properties provide information specific to this event.
Property |
Description |
Cancel |
Gets or sets a value indicating whether the event should be canceled ( Inherited from CancelEventArgs ) |
CancelingEdit |
Gets a value indicating whether the ModeChanging event was raised as a result of the user canceling an edit operation. |
NewMode |
Gets or sets the mode to which the FormView control is changing. |
FormView Members FormViewModeEventArgs FormViewModeEventHandler