Rowupdating event in gridview not firing
After it has been clicked the postback places that row in edit mode. At this point in time the above Edit Item Template is displayed with two Image Buttons within it.
One has it's Command Name = "Update" and the other "Cancel".
If you do this, your Grid View's source will be refreshed before you're able to grab the new values out of it.
I'm having a very hard time understand what would prevent your event from being fired.
Hi All, In above written code only EDIT event is being fired & that is only once after that UPDATE, CANCEL no event is being fired. All I want to do is change the Grid Row Color on the basis of the value entered in QTY field.
Also, and im no exception catching expert, it seems that your try catch blocks are a bit general.
i know its not an answer to what you are asking, but for the next time it would be a lot more easier to use the entity framework and bind it to the grid...
Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free.Storing datatable in View State is not a good practice as it increases the size of your page and reduces the performance, also View State can be deciphered on the client side, so the Data Table is not secure.I removed everything I did with View State and edited the original post again with what I currently got. I cannot sort the Grid View because I'm trying to sort with Your code doesn't have Data Source ID. Yes, I did put the breakpoint at the Row Updating line (and not in the function).You have to make sure that you aren't setting your Grid View's data when it is not postback.