Rowupdating event is not firing in gridview

I came across a very interesting error while using buttons/link buttons in the Grid View for editing the Grid View rows data.

The exact situation I faced is like this – I have a Grid View with a column which contains an edit button.

NET forums is how to deal with exceptions like The Grid View 'Grid View1' fired event Row Editing which wasn't handled.

rowupdating event is not firing in gridview-62

The HTML code for the Grid View is as follow : Till now everything looks fine but the problem arises when you run this application.

When you click on edit button of the Grid View a Javascript error occurs : “Microsoft JScript runtime error: Sys. Page Request Manager Server Error Exception: The Grid View ‘gd Test’ fired event Row Editing which wasn’t handled.” At first look you may think that you have not handled some events fired by the Grid View. The mystery behind this error is the property “Command Name”.

When we edit a row in our Grid View and press the “Update” button, at some time it’s received in the Row Updating method.

But as I noted in the comments in that method, some collections that should contain the columns (names, old values and new values) are always empty. And the Row Updated method is never even touched!!! NET Forums that I need to use a Data Source control.

Unfortunately the Data List, unlike the Gridview, does not have all the features such as paging and sorting that are commonly required.

So if you still need or want to use the Grid View, but also need more control on the way that the table is rendered, you can use the Grid View events and properties.

The button is associated with the Command Name property as “Edit”.

The Grid View is associated with the On Row Command event.

For a while now I’m trying to figure out why my method, triggered by the Grid View.

Row Updating event, doesn’t work as all samples say it should do.

NET 2.0 most of the examples and tutorials deal with setting the Data Source ID, which buys you a lot of automation that you may not even appreciate unless you’ve done this the old fashioned way.

Comments are closed.