As when I assign updated Name to Label1 it displays the old product name value and not the one in the textbox.
But I can't see why it wouldn't be bringing back the new textbox values.
In this post I will explain an issue related with Read-only data fields.
We will bound a Details View control to a Sql Data Source for simplicity reason you can use any data source control ... After configuring the pet Shop Sql Data Source and enable update, insert and delete we set the Details View Data Source Id to our pet Shop Sql Data Source Id and so the Details View now have 3 fields bound to Category table.
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.
If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Ok, Now I'm sure this was working the other day and I don't think I've changed anything but now it's not working and I can't see anything wrong with the code.
I think the problem is to do with the new values from the textbox not being retrieved.
To clarify this take a look into what's happen on the Item Updating event, if we checked the e. Keys collection before we set the Name filed as read-only filed we will find that this collection contains two Items: The Details View will not pass the read-only fields to the underlying data source and this is not an issue Details View designed like this.
Take a look to Handle Update method in the Details View control using reflector and you will find it does not include Read-only fields when extracting values from fields.
The Grid View does know the events that should be used to implement them, so the exceptions shown above are thrown when you try to perform one of these operations, but you have implemented the appropriate event handler.
The example shown here is for a Grid View, but the same types of event handlers must be implemented in roughly the same way for other data controls including the Form View, Details View, and List View. This is the final Grid View markup, so you can see the event handlers we’re going to implement.