Gridview edit, click twice problem

前端 未结 2 607
天命终不由人
天命终不由人 2021-01-12 07:54

I am using a GridView and I encountered the click twice on the Edit link to see the edit fields problem. Following advice I am binding my GridView again on the .RowEditing h

相关标签:
2条回答
  • 2021-01-12 08:29

    Found it. Needed to set the gridview's EditIndex and then do a databind.

    Private Sub gvReport_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles gvReport.RowEditing
        gvReport.DataSource = CType(Session("gvReport"), DataView)
        gvReport.EditIndex = e.NewEditIndex
        gvReport.DataBind()
    End Sub
    
    0 讨论(0)
  • 2021-01-12 08:34

    Just call your grid binding function:

    protected void GvEmployee_RowEditing(object sender, GridViewEditEventArgs e)
    {
        GvEmployee.EditIndex = e.NewEditIndex;
        bindgridview();  // method of binding gridview
    }
    
    0 讨论(0)
提交回复
热议问题