Use the RowIndex property to determine the index of the row that contains the Cancel button clicked by the user. The row index is often used to retrieve this row from the Rows collection of the GridView control, which allows you to access the row's properties.
The following example demonstrates how to use the RowIndex property to determine the index of the row containing the Cancel button clicked by the user.