GridView中的更新按钮不能触发RowUpdating事件
2013-12-15 00:25
696 查看
当点击“编辑”按钮以后,可以看到“更新”和“取消”按钮,“取消”按钮可以正常触发RowCancelingEdit事件,但是“更新”按钮不能触发RowUpdating事件。
解决方案:
在<asp:CommandField>中添加 CausesValidation="false" 。
Gridview RowUpdating Not Firing (RowUpdating event not firing on update button click for GridView Control)
After i click edit, i will get Update and Cancel button , Cancel Works. But Update doesnt.
It’s a bug of gridview .
Solution:
Add CausesValidation="false" into <asp:CommandField> .
<asp:CommandField ShowEditButton="True" ButtonType="Button" HeaderText="Edit" CausesValidation="false">
<ItemStyle HorizontalAlign="Center" Width="140px" Font-Size="12px" BorderColor="#3D90CA"
BorderStyle="Solid" BorderWidth="1px" />
<HeaderStyle CssClass="DivReportHeader" BorderStyle="Solid" Height="20px" ForeColor="#ffffff"
BorderWidth="1px" BorderColor="#0F517E" Font-Bold="True"></HeaderStyle>
</asp:CommandField>
REF:( http://objectmix.com/dotnet/352191-gridview-rowupdating-not-firing.html)
( http://www.codenewsgroups.net/group/microsoft.public.dotnet.framework.aspnet.webcontrols/topic15667.aspx )
解决方案:
在<asp:CommandField>中添加 CausesValidation="false" 。
Gridview RowUpdating Not Firing (RowUpdating event not firing on update button click for GridView Control)
After i click edit, i will get Update and Cancel button , Cancel Works. But Update doesnt.
It’s a bug of gridview .
Solution:
Add CausesValidation="false" into <asp:CommandField> .
<asp:CommandField ShowEditButton="True" ButtonType="Button" HeaderText="Edit" CausesValidation="false">
<ItemStyle HorizontalAlign="Center" Width="140px" Font-Size="12px" BorderColor="#3D90CA"
BorderStyle="Solid" BorderWidth="1px" />
<HeaderStyle CssClass="DivReportHeader" BorderStyle="Solid" Height="20px" ForeColor="#ffffff"
BorderWidth="1px" BorderColor="#0F517E" Font-Bold="True"></HeaderStyle>
</asp:CommandField>
REF:( http://objectmix.com/dotnet/352191-gridview-rowupdating-not-firing.html)
( http://www.codenewsgroups.net/group/microsoft.public.dotnet.framework.aspnet.webcontrols/topic15667.aspx )
相关文章推荐
- GridView中的更新按钮不能触发RowUpdating事件
- GridView中的更新按钮不能触发RowUpdating事件
- GridView的模版列中加入按钮,触发按钮事件后,如何获取该行的某个值?
- 在web页面上放了一些服务器按钮,在各个按钮的单击事件中都有代码!可不知道哪里出问题了,怎么操作都不能触发这些事件,好象代码一点都不执行!根本没办法调试!请高手指点一二!谢谢!
- ASP.NET中GridView自定义按钮触发事件
- gridview 双击行触发编辑(更新)事件
- gridview模板列里,按钮不能触发rowcommand
- GridView的模版列中加入按钮,触发按钮事件后,如何获取该行的某个值?
- GridView 中点击更改不能触发RowUpdating事件的解决方法
- android内嵌h5界面展示不全以及部分按钮不能触发点击事件
- GridView的模版列中加入按钮,触发按钮事件后,获取该行的某个值
- GridView的模版列中加入按钮,触发按钮事件后,如何获取该行的某个值?
- 在GridView中添加按钮后,如何触发按钮的各种事件?
- 在GridView中添加按钮后,如何触发按钮的各种事件? [转帖]
- GridView的模版列中加入按钮,触发按钮事件后,如何获取该行的某个值?
- 在GridView中添加按钮后,如何触发按钮的各种事件?
- Yii框架zii.widgets.grid自定义按钮,ajax触发事件并提示
- IOS 开发两个按钮(button)很近的时候同时触发事件解决的方法(setExclusiveTouch)
- listview的item中不同的点击按钮触发不同的点击事件
- gridview控件自定义绑定,响应模板列按钮事件