Hi,
See this sample:
In client code sample:
<Columns>
<asp:templatefield headerstyle-horizontalalign="Center" headertext="View">
<itemtemplate>
<asp:linkbutton id="viewdata" runat="server" text="View">
OnClick="viewdata_Click">
</asp:linkbutton>
</itemtemplate>
<asp:boundfield datafield="OrderId" headertext="Order Id" />
<asp:boundfield datafield="Freight" headertext="Freight" />
<asp:boundfield datafield="ShipperName" headertext="Shipper Name" />
</Columns>
</asp:templatefield>
In code behind sample:
Protected Sub viewdata_Click(sender As Object, e As EventArgs)
Dim viewdata As LinkButton = TryCast(sender, LinkButton)
Dim row As GridViewRow = DirectCast(viewdata.NamingContainer, GridViewRow)
' row.Cells(0) is the link view button...
Dim strOrderID As String = row.Cells(1).Text.Trim()
Dim strFreight As String = row.Cells(2).Text.Trim()
Dim strShipperName As String = row.Cells(3).Text.Trim()
End Sub
Hope this could help...
Please vote if could help so that others may consider as an answer...
Regards,