Rowupdating error

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”.The simplest solutions for this error is : Just change the “Command Name” property of the “Edit” button from “Edit” to “Edit Row”(or something else which is relevent to you but make sure it is not “Edit”). After scratching my head for sometime I found that the words like “Edit” are reserved to invoke some built in functionality of the Grid View.

rowupdating error-24rowupdating error-14

Some other Grid Views reserved key words and their default associated events are as follow : “Cancel” – Raises the Row Canceling Edit event.

In the event handler function I have checked for the Command Name property and write necessary code for each of the actions.

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

Suppose if we are trying to hide primary key of our table, there is actually no need to hide. In the above Snippet you are seeing a label in Item Template that means whenever we are showing Grid View to the user Label will be visible to the user.

We will use Template Field, whenever we want to define some custom control in the data bound controls like Grid View, Data Grid or Data Repeater.

Leave a Reply