System.Web 2.0.0.0 System.ComponentModel.CancelEventArgs

The event is raised when a control attempts to change between edit, insert, and read-only mode, but before the mode actually changes. This allows you to provide an event handler that performs a custom routine, such as configuring the control for a specific mode or canceling the mode change, whenever this event occurs.

A object is passed to the event handler, which allows you to determine the mode to which the control is changing, to determine whether the event was raised as a result of the user canceling an edit operation, or to indicate that an insert operation should be canceled. To determine the new mode, use the property. You can also use the property to change to an alternate mode by setting it to one of the enumeration values. Use the property to determine whether the user canceled an edit operation. To cancel an insert operation, set the property to true.

For more information about handling events, see Consuming Events.

For a list of initial property values for an instance of the class, see the constructor.

Provides data for the event.

- Constructor

  Use this constructor to initialize a new instance of the class.

  The following table shows initial property values for an instance of the class.

  Property

  Initial Value

  The value of the parameter.

  The value of the parameter.

  This constructor is used primarily by control developers when raising events.

  Initializes a new instance of the class.

  One of the enumeration values.
  true to indicate the event was raised as a result of the user canceling an edit operation; otherwise, false.
  2.0.0.0
- Property
  System.Boolean To be added.

  The event is raised when a control attempts to change between edit, insert, and read-only mode, but before the mode actually changes. Use the property to determine whether the event was raised as a result of the user canceling an edit operation. For example, you might want to reset the control whenever the user cancels an edit operation.

  Gets a value indicating whether the event was raised as a result of the user canceling an edit operation.

  2.0.0.0
- Property
  System.Web.UI.WebControls.DetailsViewMode To be added.

  Use the property to determine the mode to which the control is changing. For example, you might want to configure the control based on the mode to which it changes. You can also use this property to specify the mode to which the control changes by setting it to one of the enumeration values.

  Gets or sets the mode to which the control is changing.

  2.0.0.0