更新gridview的所有行 [英] update all rows in gridview

查看:129
本文介绍了更新gridview的所有行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个gridview,两个按钮(编辑,保存),什么我想要做的是:

i have a gridview,two buttons(edit,save) ,what i wanna to do is :

当点击编辑打开的GridView在编辑模式下所有的文本框。

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)

我使用对象数据源。

推荐答案

A 的GridView 是不是真的换货一次修改的所有行。要做到这一点,它实际上没有那么简单。如果你想,虽然做到这一点,看看下面的文章:

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:

真实世界GridView控件:批量编辑

我会建议不使用的GridView 和使用转发来显示您的数据。然后,当你想要编辑,使用不同的页面(或面板采用了不同的转发),以显示你的编辑控件。您的code会有很多更容易维护与此解决方案。

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.

这篇关于更新gridview的所有行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆