GridView中的更新按钮不能触发RowUpdating事件
2009-03-02 22:57
411 查看
当点击“编辑”按钮以后,可以看到“更新”和“取消”按钮,“取消”按钮可以正常触发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模板列里,按钮不能触发rowcommand
- JAVA SWING中给按钮添加监听器后JFrame界面JProgressBar不能动态更新问题
- GridView中出现“TemplateField 上不支持回调,因为某些控件不能在回调中正确更新。”的解决方法
- GridView中的编辑和删除按钮,执行更新和删除代码之前的更新提示或删除提示
- GridView中按钮的编辑模式和更新数据
- gridview设置某一列为只读按更新按钮后值为空
- 把GridView控件完全放入UpdatePanel中时,实现了点击编辑、更新等按钮时,页面不再刷新,对话框不起作用
- WebForm GridView设置分页,编辑,更新,取消,删除,按钮,以及排序。
- GridView的模版列中加入按钮,触发按钮事件后,如何获取该行的某个值?
- GridView不能编辑更新或删除问题之一
- GridView连接SQL Server 2005实现增加、更新、删除按钮时遇到的两个错误及解决办法
- GridView的模版列中加入按钮,触发按钮事件后,如何获取该行的某个值?
- 关于ViewGroup 中listview 和GridView数据不能动态更新的解决
- 关于ViewGroup 中listview 和GridView数据不能动态更新的解决
- GridView控件中如何并排摆放更新和取消按钮
- GridView 中点击更改不能触发RowUpdating事件的解决方法
- gridview 双击行触发编辑(更新)事件
- 关于ViewGroup 中listview 和GridView数据不能动态更新的解决