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. I have a Details View with a Drop Down List in an Edit Item Template, I know, pretty cool right?
Since we ve already discussed the inserting, editing, and deleting capabilities of the Grid View, Details View, and Form View controls, this tutorial will focus on configuring the Sql Data Source control to support these operations.
control enables you to perform all these operations without writing Select, Update, Insert, or Delete statements.
Or, at least, not declaratively and, maybe, not easily.
One of the flexible and new features came with ASP. This data bound control is used to display the values of a single record from a data source in an HTML table, where each table row represents a field of the record.
Now, we have Edit button on Details View control in ASP. When we click Edit Button that time we need to change mode of Details View control for Editing Records.
For Editing set Autogenerate Edit Button = True at property of Details View control.I'll post the ASP code, hopefully someone can help me with this one. In previous tutorials we learned how the Object Data Source control allowed for inserting, updating, and deleting of data.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.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.Here, we will learn how to edit, update, delete record to Details View in ASP. If you click Cancel Button then Details View back to original Readonly mode.