I have a datagrid on an ASP. NET web application....but for some reason, I have to click the edit button twice before it will actually go into edit mode. Is there something I'm doing wrong..... I've attached the code to this mail.

Public Sub dgTemp_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgTemp.EditCommand

dgTemp.EditItemIndex = e.Item.ItemIndex
Label1.Text = e.Item.ItemIndex
' Refresh view
OnUpdateView(EventArgs.Empty)

End Sub


' *** EVENT: UpdateView
Public Event UpdateView As EventHandler

Public Sub OnUpdateView(ByVal e As EventArgs)
RaiseEvent UpdateView(Me, e)
End Sub


Any help with this would be GREATLY appreciated!!!

Patrick