如何阻止rowcommand事件在gridview中执行? [英] how to stop rowcommand event from getting executed in a gridview ?

查看:71
本文介绍了如何阻止rowcommand事件在gridview中执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp:TemplateField中有一个带有复选框的gridview。我希望选择多个复选框,并在按钮单击时,我想在另一个由转发器组成的页面中添加这些选定的行。另外,我希望用户能够在单击任何行时选择单个行。 br $>


我的问题是当我点击任何一个复选框时,rowcommand被触发并且一条记录被添加到转发器。

我希望当选中/取消选中复选框时,防止此rowcommand事件被触发。



请指导我解决此问题。

谢谢。

I have a gridview with checkbox inside asp:TemplateField. I wish to select multiple checkboxes and on button click I want to add those selected rows in another page which consists of the repeater.Also I want to give the ability to the user to select a single row when any of the row is clicked.

My problem is when I click any of the checkbox,the rowcommand gets fired and one record gets added to the repeater.
I wish to prevent this rowcommand event to get fired when checkbox is checked/unchecked.

Kindly guide me on this issue.
Thanks.

推荐答案



请将autopostback属性设置为false然后尝试。
Hi,
Please give autopostback property set to false and then try it.


检查此链接

http://stackoverflow.com/questions/9224657/how-to-stop-rowcommand-event-from-getting-executed-in-a-gridview



希望它对你有帮助!
check this link
http://stackoverflow.com/questions/9224657/how-to-stop-rowcommand-event-from-getting-executed-in-a-gridview

Hope it helps you!


这篇关于如何阻止rowcommand事件在gridview中执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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