如何在网格视图中编辑和更新记录?

问题描述:

我的项目中有一个网格视图。每条记录都有一个命令事件EDIT,允许用户更新记录。我的教授希望我只有一个编辑按钮,允许网格视图中的所有记录都在要编辑的文本框内。如果编辑了网格视图中的任何记录,则编辑按钮将变为UPDATE按钮,并将更改保存在网格视图中。有什么帮助?

I have a grid view in my project. Each record has a command event EDIT that allows the user to update the records.My professor would like me to have ONLY ONE edit button that will allow all the records in the grid view will be inside a text box to be edited. And if any of the records inside the grid view edited, the edit button will become an UPDATE button and will save the changes inside the grid view. Any help?

你真正想要的是在编辑模式下显示所有行。然后当点击按钮时,你循环并处理每一行。



一个例子:

http://aspadvice.com/blogs/azamsharp/archive/2006/11/08 /Show-all-GridView-Rows-in-EditMode.aspx [ ^ ]
What you really want is to show all rows in Edit Mode. Then when the button is clicked you loop through and process each row.

An example:
http://aspadvice.com/blogs/azamsharp/archive/2006/11/08/Show-all-GridView-Rows-in-EditMode.aspx[^]