|
FormView event
The FormView control can trigger events that occur when the current record is displayed or changed. Clicking a command control (such as a Button control that is part of the FormView control) also raises an event. The following table describes the events exposed by the FormView control.
PageIndexChanging
Occurs when a page navigation button is clicked, but before the FormView control performs a paging operation. This event is usually used to cancel the paging operation.
PageIndexChanged
Occurs when a page navigation button is clicked, but after the FormView control performs a paging operation. This event is usually used when a user needs to perform a certain task after locating to a different record in the control.
ItemCommand
Occurs when a button in the FormView control is clicked. This event is usually used to perform a task when a button in the control is clicked.
ItemCreated
Occurs after all FormViewRow objects have been created in the FormView control. This event is usually used to modify the value to be displayed in a row before displaying the row.
ItemDeleting
Occurs when you click the Delete button (the button whose CommandName property is set to "Delete"), but before the FormView control deletes the record from the data source. This event is usually used to cancel the delete operation.
ItemDeleted
Occurs when the Delete button is clicked, but after the FormView control deletes the record from the data source. This event is usually used to check the result of the delete operation.
ItemInserting
Occurs when the Insert button (the button whose CommandName property is set to "Insert") is clicked, but before the FormView control inserts the record. This event is usually used to cancel the insert operation.
ItemInserted
Occurs when the Insert button is clicked, but after the FormView control inserts the record. This event is usually used to check the result of the insert operation.
ItemUpdating
Occurs when the Update button (the button whose CommandName property is set to "Update") is clicked, but before the FormView control updates the record. This event is usually used to cancel the update operation.
ItemUpdated
Occurs when the Update button is clicked, but after the FormView control updates the row. This event is usually used to check the result of the update operation.
ModeChanging
Occurs before the FormView control changes mode (change to edit, insert, or read-only mode). This event is usually used to cancel mode changes.
ModeChanged
Occurs after the FormView control changes mode (change to edit, insert, or read-only mode). This event is usually used to perform a task when the FormView control changes mode.
DataBound
This event is inherited from the BaseDataBoundControl control and occurs after the FormView control has finished binding to the data source. |
|