當點擊「編輯」按鈕之後,能夠看到「更新」和「取消」按鈕,「取消」按鈕能夠正常觸發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.html)get