Visual C# (.NET)

system.web.httpexception: The GridView ‘NameOfGridView’ fired event RowDeleting which wasn’t handled

If you get the “system.web.httpexception: The GridView ‘NameOfGridView’ fired event RowDeleting which wasn’t handled” error:

If you have a DELETE button, or whatever button which “CommandName”s property is “DELETE” in the GridView, .NET will automatically try to fire “OnRowDeleting” event.

We have 2 solution for this error message:

1) You can add “OnRowDeleting “property and function for this GridView.

.aspx part (grid properties):
OnRowDeleting="NameOfGridView_RowDeleting"

.cs part:
void NameOfGridView_RowDeleting (object sender, GridViewDeleteEventArgs e)
{
}

2) If you have regular button in the GridView, you can change this button’s “CommandName” property different from “Delete”. For Example, if you change it to “Del” instead of “Delete”, you won’t get this error message and everything will be OK.

Tags: , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*