Edit the gridview example. The complete code is as follows.
Copy codeThe Code is as follows:
Protected void gridviewinclurowediting (object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e. NewEditIndex;
BingGrid ();
}
Protected void GridView1_RowCancelingEdit (object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex =-1;
BingGrid ();
}
Protected void GridView1_RowUpdating (object sender, GridViewUpdateEventArgs e)
{
Try
{
GridViewRow row = GridView1.Rows [e. RowIndex];
String TXB_FORUMNAME = (TextBox) row. FindControl ("TXB_FORUMNAME"). Text. Trim (). ToString ();
Int TXB_ROOTFORUMID = Convert. ToInt16 (TextBox) row. FindControl ("TXB_ROOTFORUMID"). Text. Trim ());
Int TXB_ISDISPLAY = Convert. ToInt16 (TextBox) row. FindControl ("TXB_ISDISPLAY"). Text. Trim ());
String TXB_MASTER = (TextBox) row. FindControl ("TXB_MASTER"). Text. ToString ();
Int TXB_ISLOCK = Convert. ToInt16 (TextBox) row. FindControl ("TXB_ISLOCK"). Text. Trim ());
Int LB_FORUMID = Convert. ToInt16 (Label) row. FindControl ("Label6"). Text );
ForumBLL. Forum_Update_Name (TXB_FORUMNAME, TXB_ISDISPLAY, TXB_ROOTFORUMID, TXB_MASTER, TXB_ISLOCK, LB_FORUMID );
}
Catch (Exception ex)
{
Response. Write (ex );
}
GridView1.EditIndex =-1;
BingGrid ();
}
Directly edit the GridView and delete the download of the classic example.