Hai
Why u add link button dynamicall in grid view,why u not try to add link button for one field like if u have 3 colums in grid view like ID,Name and Address. in Name column u can add link button. Textbox used show value and link button used for edit users for further process, try my code
<asp:TemplateField HeaderText="Name">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton4" runat="server" CommandArgument='<%#Bind("UserId")%>' CommandName="EditUser" Text='<%# Bind("Name") %>'>LinkButton</asp:LinkButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
Protected Sub gvAll_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvAll.RowCommand
If e.CommandName = "EditUser" Then
End If
End Sub
in above grid view code i will add link button for name field,so it show Name with link button,if u click name it act as link button.
Note : u not mention for use of link button,for delete,edit ? in my eg used for edit users in grid view,if u want delete u need to use separate link button.so pls mention for what purpose u use ?
Regards
Aravind