System.Web.UI.WebControls.DataGrid.CancelCommand Event

Occurs when the Cancel button is clicked for an item in the System.Web.UI.WebControls.DataGrid control.

Syntax

public event DataGridCommandEventHandler CancelCommand

Remarks

The DataGrid.CancelCommand event is raised when the Cancel button is clicked for an item in the System.Web.UI.WebControls.DataGrid control.

A typical handler for the DataGrid.CancelCommand event sets the DataGrid.EditItemIndex property to -1 (to deselect the item) and then rebinds the data to the System.Web.UI.WebControls.DataGrid control.

Note:

Text is not HTML encoded before it is displayed in the System.Web.UI.WebControls.DataGrid control. This makes it possible to embed script within HTML tags in the text. If the values for the control come from user input, be sure to validate the values to reduce security vulnerabilities.

For more information about handling events, see [<topic://cpconEventsOverview>].

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0