GridView Edit Button Requires 2 Clicks

后端 未结 1 1483
花落未央
花落未央 2021-01-13 18:55

When pressing edit button in gridview, edit template is displayed only after 2 clicks. And another problem: Value of the field to edit is displayed in gridview initially, bu

1条回答
  •  -上瘾入骨i
    2021-01-13 19:20

    I think you need to call DataBind to rebind the data source. You've commented it out, but it looks like you had it in a IsPostBack block, which would only execute on the initial page load.

    Try:

    Protected Sub EditRow(ByVal sender As Object, ByVal e As GridViewEditEventArgs)
        GridView1.EditIndex = e.NewEditIndex
        GridView1.DataSource = SqlDataSource1
        GridView1.DataBind()        
    End Sub
    

    0 讨论(0)
提交回复
热议问题