You'll need to write some code in your RowDataBound event for the given GridView you're binding to. In that method, you can add as many controls as you'd like dynamically with some simple code. In addition, you can leverage the CommandName and CommandArgument properties for easy click handling.
Your RowDataBound event will have the following code in it.
If e.Row.RowType = DataControlRowType.DataRow Then
Dim SpecialLink As New LinkButton()
SpecialLink.CommandName = "FancyCommand"
SpecialLink.CommandArgument = e.Row.RowIndex.ToString ''//Or your Unique Data Id too.
SpecialLink.Text = "Click me to do custom work."
e.Row.Cells(0).Controls.Add(SpecialLink) ''//Put it in whatever grid cell you'd like
End If
Then you can use the RowCommand event to process your command easily enough.
Private Sub ProcessGridCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) _
Handles gvComments.RowCommand
Select Case e.CommandName
Case "FancyCommand"
DoSpecialProcessing(e.CommandArgument)
End Select
End Sub
I like to use the Select only because it makes it easy to add more custom commands later. You can easily redo this code for C# if needs be.
In addition, if you need to add more than 1 link button, you can do it really fast in the code without having a bunch of placeholder links that may be set to visible or hidden.
EDIT: So after a quick dig, if you want to call your JavaScript code, then ditch the CommandName/Command Arguments above and you can do the following:
SpecialLink.Attributes("OnClick") = "lnkDocumentOne_Click();"
You may need to create a "catch all" type JavaScript method to handle the various links that would be calling it, or you can also use the Page.RegisterClientScript method to register all the JavaScript methods and create those dynamically as well.