Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all

i had a grid view in which i one column bounded with hyperlink field when i click the hyperlink i need to get the values of each cell. i dont know the process can any one tell me please or provide sample code please

thanks in advance
Posted
Updated 8-Dec-10 18:43pm
v2

In Row Command event use the code as below :

C#
protected void grdDocs_RowCommand(object sender, GridViewCommandEventArgs e)
       {
           if (e.CommandName == "Download")
           {
               GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
}
}


Cast your command source as a type of the control you have.
 
Share this answer
 
for that ou need to get the clicked row, from that you can find each cell. To get the row, have a look to the following link

Click here
 
Share this answer
 
check the similar discussion here[^]
 
Share this answer
 
VB
Private Sub dgViewUsers_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgViewUsers.ItemCommand
       If e.CommandName = "Activate" Then
           UserName = dgViewUsers.Items(e.Item.ItemIndex).Cells(0).Text
           Activate_User()
           GetUsers()
       End If
   End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900