System.Web.UI.WebControls Namespace DetailsView Class
.NET Framework version 2.0
Occurs when the DetailsView control switches between edit, insert, and read-only mode, but before the mode changes.
[ VB ]
Public Event ModeChanging As DetailsViewModeEventHandler
[ C# ]
public event DetailsViewModeEventHandler ModeChanging;
[ C++ ]
public: __event DetailsViewModeEventHandler* 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 DetailsView 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 DetailsView 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 DetailsViewModeEventArgs object containing data related to this event. The following DetailsViewModeEventArgs 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 DetailsView control is changing. |
DetailsView Members DetailsViewModeEventArgs DetailsViewModeEventHandler