The Update button in the gridview cannot trigger the rowupdating event.

Source: Internet
Author: User

After you click the edit button, you can see the update and cancel buttons. The cancel button can trigger the rowcancelingedit event normally, but the update button cannot trigger the rowupdating event.

Solution:

In <asp: commandfield>, addCausesvalidation = "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:

AddCausesvalidation = "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"> </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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.