Detailsview not updating gridview
As Figure 4 shows, when the page is visited through a browser a Delete button is included. Figure 4: Each Grid View Row Now Includes a Delete Button (Click to view full-size image) Upon clicking a Delete button, a postback occurs, the Grid View assigns the Figure 5 depicts this interaction graphically.
Refer back to the Examining the Events Associated with Inserting, Updating, and Deleting tutorial for a more detailed discussion on the chain of events associated with inserting, updating, and deleting from a data Web control.
Clicking the Edit button turns the Details View into edit mode, which displays each Bound Field whose (the default) as a Text Box, and the Check Box Field as a checkbox.
Figure 9: The Details View s Default Editing Interface (Click to view full-size image) Similarly, you can delete the currently selected product or add a new product to the system.
Figure 5: Clicking the Delete Button in the Grid View Invokes the Sql Data Source s SQL statements can be specified through the Properties window or the control s declarative syntax.
However, this approach requires that we manually write out the SQL statements by hand, which can be monotonous and error-prone.
For now, let s use the Properties window in the Designer, although the Configure Data Source wizard or declarative syntax option would work just as well.Fortunately, the Configure Data Source wizard provides an option to have the statements checkbox will only be checkable if the table selected has a primary key and the primary key column (or columns) are included in the list of returned columns.The Use optimistic concurrency checkbox, which becomes selectable once the Generate statements to provide optimistic concurrency control.From the Designer in Sql Data Source and then bring up the Properties window (from the View menu, choose Properties window, or simply hit F4).Select the Delete Query property, which will bring up a set of ellipses.