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
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