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