如何在ASP.NET GridView中勾选复选框而无需进入编辑模式 [英] How to tick a Checkbox in ASP.NET GridView without going to Edit mode

查看:628
本文介绍了如何在ASP.NET GridView中勾选复选框而无需进入编辑模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP.NET 3.5 GridView中有一个Checkbox模板列。现在用户必须点击'编辑',勾选复选框,然后点击'更新'或'取消'按钮,这会引发一个我们用来更新数据库的事件。



是否有可能在没有进入编辑模式的情况下检查框并提出Checked事件以便我们可以更新数据库?或者,我们可以循环遍历所有行,识别打勾的行并在循环中将它们更新到数据库。



任何指针都有帮助。



感谢,
Chak。

解决方案

试试,

Gridview的行单击事件...



参考 c#gridview row click


I have a Checkbox template column in a ASP.NET 3.5 GridView. Now the user has to click 'Edit', tick the Checkbox, then click the 'Update' or 'Cancel' button, which raises an event that we use to update database.

Is it possible to just check the box without going into Edit mode at all and raise a Checked event so that we can update database ? Alternately we can iterate through all rows, identify ticked rows and update them to DB in a loop.

Any pointers helpful.

Thanks, Chak.

解决方案

Try,

Row click event of gridview...

Ref this c# gridview row click

这篇关于如何在ASP.NET GridView中勾选复选框而无需进入编辑模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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