Asp net detailsview not updating
I solve this problem by canceling the Item Updating event, changing the mode, and rebinding the details view data source.This was the only way I got things to worked for me.After the user clicks the update button to edit and update selected record details, if he or she clicks the Add Row Button then they will be able to add a new record to the database.I was stocked for sometime using the 2.0 Details View control to Edit/Update data.The edit button required two clicks to change the mode to Edit instead of Read Only.
Basically I have a details view with product information in it, when the user clicks edit it goes into edit mode when I change any of the fields and click update it updates but with the old values.
The Item Updating event is raised when an Update button within a Details View control is clicked, but before the update operation.
This allows you to provide an event handler that performs a custom routine, such as canceling the update operation, whenever this event occurs.
I wanted to do my custom implementation for the Update command instead of using the Data Binding Object sources but I found my self in trouble with several road blocks.
Problem 1: When clicking on the Edit button the Details View will not change the mode until the second click.