I bind the data on each postback which I think might be part of the problem. One thing I did notice is that is that when the update button is clicked not even the Row Command event is fired, which I thought was strange.Also, the data source is a Sub Sonic table class that is stored in Session (If you don't know Sub Sonic is just a little provider that maps tables into classes so you can object oriented version of you tables that intellisense will recognize, a pretty nifty tool).I know this happens after an update command happens on the database, but I want to write my own custom update.
I have a simple Grid View bound to a Data Table at runtime.For some reason when you click "Edit" to edit the contents of a row, then "Update" the Row Updating event is never called (i.e. 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. The problem might be with the Auto Generated Edit Button.The Grid View control resides in a User Control which is referenced in an page that is housed inside a Master Page.
the View state is disabled because I need the the Grid View to be displayed even when there is no data.
R Since you posted no code, let's guess at it shall we?
Or you're databinding the grid in page_load and you didn't put that code inside of an if (! but if i put like that then gridview will not show any value when i click edit button in gridview. Select Command ="select M.*,(select emp_name ' ' emp_initial from view_allemployees where emp_number =M. Mob Req ID) as Applied For from Forms_Mob Request M where (Appr HRStatus "select M.*,(select emp_name ' ' emp_initial from view_allemployees where emp_number =M. Mob Req ID) as Applied For from Forms_Mob Request M where Appl Status = 'C' ""select M.*,(select emp_name ' ' emp_initial from view_allemployees where emp_number =M. Mob Req ID) as Applied For from Forms_Mob Request M where Appl Status = 'O' " Superguppie. If you have it set to false, you will need to do Data Bind on Post Back BEFORE Page_Load. Please remember to click “Mark as Answer” on the post that helps you.
I've had this happens once (or twice) before and I resolved it by doing that. You are saying "delete doesn't work" - meaning, event doesn't fire OR doesn't delete from the database?
Peter, The delete doesnt work mean..Rowdeleting is not fired at all when I click Delete link.
I'll also suggest that you use the Data Keys property to get your rowid instead of using the hidden label; or use e. perhaps, as each requires an individual handler, Row Editing as well as Row Deleting. I don't have a clue this time, else I would have posted.