Rowupdating oldvalues empty
The difference between your code and the code on MSDN is: - The MSDN code takes the new data from the edited row and updates the appropriate data in the To me, this is garbage, because it's so highly coupled to the order of your cells. NET that is bound programatically in the Page_Load function. However, when I click on 'Update' on a row (after clicking'edit' and making a change), I'm not able to find or see the oldvalues or newvalues in Grid View1_Row Updating.
A Grid View Update Event Args object is passed to the event-handling method, which enables you to determine the index of the current row and to indicate that the update operation should be canceled.
How do I get the old values in a gridview row in the row_updating event? But it doesn't work for index items greater than 0. Must be non-negative and less than the size of the collection.
I'm using a sqldatasource control to populate the grid and want to write the update code in the Row Updating event. I can get the value of the first field using string old_Category = e.
Although this isn't as big of a problem when you're referencing the text from web controls, getting in the habit now will prevent you from serious headaches and inefficiently checking for null and empty later. NET 4.0, you should have access to event, you need to pull the new values out of the front-end controls, and then re-bind your data.
It looks like your source code is pretty close to the MSDN source code here.