Row updating in grid view
NET Putting updateable controls in the Item Template in a Grid View gives developers what they want: the ability for users to change more than one row at a time. By default, in a Grid View users can only put one row at a time into edit mode. While this is possible, it's not in the "natural" design of the Grid View.When users are updating multiple rows they get saddled with a very repetitious workflow: Click the Edit button for the first row... The trick is to populate the Item Template -- normally reserved for displaying data -- with controls that allow the user to enter data.The solution is to use the Data Table's Select method to find the row in the Data Table that matches the row in the Grid View.In this example, I'm searching the Data Set using the table's primary key -- a column called "Id" -- that's displayed in the first column in the Grid View.A Grid View Updated Event Args object is passed to the event-handling method, which enables you to determine the number of rows affected and any exceptions that might have occurred. You can also indicate whether the exception was handled in the event-handling method by setting the On Row Updated Row Canceling Edit On Row Canceling Edit Row Deleted On Row Deleted Row Deleting On Row Deleting Row Editing On Row Editing Row Updating On Row Updating Grid View Class System. The second step was to edit that Template column and replace the default control in the column with an updateable control.
The Data Grid was driven by a Data Table in a Data Set that held all the rows for the survey, along with the current user's response.When the user finished making their changes, they clicked an "Update Survey" button on the page.In the Click event of that button, we needed to capture the user's entries in each row and update the Data Set with the Survey data. All the developer wanted to do was give the user the ability to work down one column in the Grid View that contained a Radio Button List, checking off a choice in each row. As an example, I recently had a question from a developer who was creating a survey.
" Select Command="SELECT a.tenantcode, a.name, a.fixedrate, a.percentrate, a.percentage, b.locationd, c.status FROM TENANTNEW AS a INNER JOIN LOCATION AS b ON a.