GridView中的更新按钮不能触发RowUpdating事件

当点击“编辑”按钮之后,能够看到“更新”和“取消”按钮,“取消”按钮能够正常触发RowCancelingEdit事件,可是“更新”按钮不能触发RowUpdating事件。html

解决方案:web

在<asp:CommandField>中添加 CausesValidation="false" spa

 

Gridview RowUpdating Not Firing (RowUpdating event not firing on update button click for GridView Control).net

After i click edit, i will get Update and Cancel button , Cancel Works. But Update doesnt.code

It’s a bug of gridview .orm

Solution:htm

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>ci

 

REF:( http://objectmix.com/dotnet/352191-gridview-rowupdating-not-firing.htmlget

( http://www.codenewsgroups.net/group/microsoft.public.dotnet.framework.aspnet.webcontrols/topic15667.aspx)

相关文章
相关标签/搜索