Rowupdating event of grid view in asp net
Hi, I have a gridview with some template columns and have set Autogenereate Edit Columns="True". But when I add a required field validator to one of the columns in edit item template rowupdating event is not firing. Here is a sample button: This does the same as Auto Generate buttons do.
Can any one suggest me how I can get rowupdating event to fire in such a condition? Also You might have missnamed the control to validate for the required fieldvalidatore. If it does not solve the problem show us ur code so that we can help better In case of client side validations postback itself should not happen. In my case post back is happening and all other events including rowcommand event is firing with the command name as update. Hi, I have a gridview with some template columns and have set Autogenereate Edit Columns="True". But when I add a required field validator to one of the columns in edit item template rowupdating event is not firing. Instead of having Auto Generated Edit button, you can manually use Link Buttons.
I subsequently changed the code behind to explicitly bind to the product table during Row Cancel and Row Edit events.
So, the Row Update event didn't fire because there was no indication of a Row Update existing.
It might be because the field is empty which is causing client side validations. Can any one suggest me how I can get rowupdating event to fire in such a condition? As you've insert a validation control, if fires the validation when you click on edit.
If you are using command buttons, then do not use Auto Generate Edit Button.
Here you specify the Command Name for the respective linkbuttons which fires the Row_Editing event for "Edit" command, Row_Updating event for "Update" command and Row_Cancelling event for "Cancel" command. Acording to my experiences of the problem, I think you can solve the problem by trying these steps: 1) Since you've added a reqieured Validator in the Edit Template, have you confirmed that your Update Button's Command Name is "Update"?
Have you re-written your Grid View_Row Updating event?
This enables you to provide an event-handling method that performs a custom routine whenever this event occurs.
Next event is the Grid View Row Editing event to give ASP.