i have a gridview,two buttons(edit,save) ,what i wanna to do is :
when click edit开发者_运维知识库 open the gridview in edit mode for all the textboxes.
when click save takes the changes and update
(rather than edit and update row by row)
i use object data source.
A GridView
is not really ment to edit all rows at once. To do so it's actually not that straight forward. If you want to do it though, check out the following article:
Real World GridView: Bulk Editing
I would recommend not using a GridView
and using a Repeater
to show your data. Then when you want to edit, use a different page (or a panel with a different Repeater
) to display your edit controls. Your code will be a lot more maintainable with this solution.
You didn't explain why you need to edit all rows at once so either way one of the above solutions should work.
精彩评论