System.Web.UI.WebControls Namespace FormView Class
.NET Framework version 2.0
Occurs when a Delete command button within a FormView control is clicked, but before the delete operation.
[ VB ]
Public Event ItemDeleting As FormViewDeleteEventHandler
[ C# ]
public event FormViewDeleteEventHandler ItemDeleting;
[ C++ ]
public: __event FormViewDeleteEventHandler* ItemDeleting;
In [ JScript ], you can handle the events defined by a class, but you cannot define your own.
The ItemDeleting event is raised whenever a Delete button associated with an item in the FormView control is clicked, but before the FormView control deletes the record.
This allows you to provide an event-handling method that performs a custom routine, such as verifying a record before deleting it, whenever this event occurs.
Information related to the ItemDeleting event is passed via a FormViewDeleteEventArgs object to the method assigned to handle the event. The following FormViewDeleteEventArgs 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 ) |
Keys |
Gets an ordered dictionary of key field name/value pairs for the record to delete. |
RowIndex |
Gets the index of the record being deleted from the data source. |
Values |
Gets a dictionary of the non-key field name/value pairs for the item to delete. |
FormView Members Allowing Users to Delete Items in a FormView Control