e.Row.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(DirectCast(sender, System.Web.UI.Control), "Select$" + e.Row.RowIndex.ToString()))
Then on the RowCommand Event:
If e.CommandName = "Select" Then
GridView1.EditIndex = e.CommandArgument
End If
You can download a sample Visual Studio 2005 solution here
Update
---------------------------
Getting this error message?
Invalid postback or callback argument. Event validation is enabled using
If you don't want to set enable event validation to false then you can try the following:
Protected Overloads Overrides Sub Render(ByVal writer As HtmlTextWriter)
For i As Integer = 0 To Me.gv1.Rows.Count - 1
Page.ClientScript.RegisterForEventValidation(Me.gv1.UniqueID, "Select$" & i)
Next
MyBase.Render(writer)
End Sub