Hi,
See sample code:
Example:
In your Client Code you have to have a column TemplateField in your Grid...
<asp:TemplateField HeaderStyle-HorizontalAlign="Center"HeaderText="View">
<itemtemplate>
<asp:LinkButton ID="viewdata" runat="server" Text="View"
OnClick="viewdata_Click">
</itemtemplate>
In your code behind:
protected void viewdata_Click(object sender, EventArgs e)
{
LinkButton viewdata = sender as LinkButton;
GridViewRow row = (GridViewRow)viewdata.NamingContainer;
string column3 = row.Cells[2].Text.Trim();
}
In above example 3rd column or cell on your grid is
ClaimNo
The variable column3 should be the value of
ClaimNo because the column index begins at 0.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Hope this could help...
Regards,
Algem