The Asp.net GridView control enables you to edit cells for ease of use.

Source: Internet
Author: User

Recently, we made a function to reduce the number of pop-up pages for the convenience of users. You can click the "edit" button to edit the cell content of the current row without the pop-up page. The page is displayed as follows:
 
Click the "edit" button to display the following information:
 
You can edit "Week" and "whether to go to work" with ID 1. After editing, click "Update" to save.
The Data Loading Method in the first figure is as follows:
Protectedvoid GridView_RowDataBound (object sender, GridViewRowEventArgs e)
{......}
The data modified in the second figure is implemented through the following methods:
ProtectedvoidGridView_Pue_RowUpdating (object sender, GridViewUpdateEventArgs e)
{......}
I thought this could be done. Who knows that the "triggered unprocessed event RowEditing" error occurs when the update button is clicked:
 
Added
ProtectedvoidGridView_RowEditing (object sender, GridViewEditEventArgs e)
{......}
To solve this problem, you need to click the "edit" button twice each time to see the interface shown in figure 2, after debugging, it is found that the first "edit" button is jumped into the GridView_RowEditing method, and the code is added to the method:
GridView. EditIndex = e. NewEditIndex;
BindGrid ();
Solve this problem

Related Article

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.