Our goal is to extend this example to allow for the user to delete products via the Grid View.To accomplish this we need to specify values for the Sql Data Source control s statement created in Step 2.Summary : Usually developers do not use an editable Grid View for many reasons. First fill then create a bool function and go to assemble row editing & updating event.
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.
However, this approach requires that we manually write out the SQL statements by hand, which can be monotonous and error-prone.
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.
Once we add deleting support to the Grid View, the Grid View will automatically supply this parameter value, using the value of its property added, the Grid View s smart tag now contains the Enable Deleting option. As discussed in An Overview of Inserting, Updating, and Deleting, this causes the Grid View to add a Command Field with its .
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.