Share via


DetailsView Web Server Control Events

The DetailsView control raises a number of events in the course of navigating and updating its bound data to which your code can respond. For an example that uses some of the DetailsView events, see Modifying Data Using a DetailsView Web Server Control.

The DetailsView control raises events that occur when the current record is displayed or changed. Events are also raised when a command control such as a Button that is part of the DetailsView control has been clicked. The following table describes the events exposed by the DetailsView control.

  • PageIndexChanging
    Occurs when a Page button (a button with its CommandName property set to "Page") has been clicked, but before navigating to a new page of data.
  • PageIndexChanged
    Occurs when a Page button has been clicked, but after a navigating to a new page of data.
  • ItemCommand
    Occurs when a button within a DetailsView control is clicked.
  • ItemCreated
    Occurs when a record is created in a DetailsView control.
  • ItemDeleting
    Occurs when a Delete button (a button with its CommandName property set to "Delete") within a DetailsView control is clicked, but before the delete operation.
  • ItemDeleted
    Occurs when a Delete button within a DetailsView control is clicked, but after the delete operation.
  • ItemInserting
    Occurs when an Insert button (a button with its CommandName property set to "Insert") within a DetailsView control is clicked, but before the insert operation.
  • ItemInserted
    Occurs when an Insert button within a DetailsView control is clicked, but after the insert operation.
  • ItemUpdating
    Occurs when an Update button (a button with its CommandName property set to "Update") within a DetailsView control is clicked, but before the update operation.
  • ItemUpdated
    Occurs when an Update button within a DetailsView control is clicked, but after the update operation.
  • ModeChanging
    Occurs when a DetailsView control attempts to change between edit, insert, and read-only modes, but before the CurrentMode property is updated.
  • ModeChanged
    Occurs when a DetailsView control attempts to change between edit, insert, and read-only modes, but after the CurrentMode property is updated.
  • DataBound
    This event is inherited from the BaseDataBoundControl control and occurs after the DetailsView control has finished binding to the data source.

See Also

Reference

DetailsView Web Server Control Overview

Other Resources

DetailsView Web Server Control