Asp net gridview rowupdating dropdownlist
To start, the Grid View's Sql Data Source must contain an Update Command with appropriate parameters.As we saw in the Deleting a Grid View's Underlying Data section, creating such a Sql Data Source is as simple as checking the Generate Insert, Update, and Delete Statements from the dialog box shown back in Figure 35.Additionally, the standard Text Box as an editing interface might not be acceptable; we'll also look at an example that replaces the Text Box with a databound Drop Down List.
A particular field may be required or might need to be entered in a specific format.
As with the Delete example, the signature for the Update method depends on the Object Data Source's Conflict Detection property.
If you are using the default behavior—Overwrite Changes—then the Update method needs to accept the original primary key field(s) along with parameters for the non-primary key updated values.
We'll look at the required signature for the Update method and see how to configure the Object Data Source to use this method.
In the last two demos we'll see how to customize the editing interface for a Grid View column.
When poking through the markup below, be sure to take note of the following: checking the Use optimistic concurrency checkbox.