Passing Gridview row details to Code behind function.

Posted by Sashys under ASP.NET on 7/8/2012 | Points: 10 | Views : 2693 | Status : [Member] | Replies : 1
Hi Friends,
Need a help on the below context..
I have parent gridview where all the rows are bounded and few of the colums are hypher link. when i click on any hypher link data, i have to pick up all the values in the corresponding row and pass it to code behind function as parameters. Basically that code behind function will call backend data base and pull the values and show in to child grid.. pls let me know if any clarification needed on this..


Sasikumar .M


Posted by: Johnbhatt on: 7/8/2012 [Member] Starter | Points: 25

Either go to Edit Items option in GridView and then Double Click your Hyperlink to get what you are expecting. Another traditional method is to Pass a CommandName parameter into Hyperlink and Code all codes inside RowCommand event of GridView according to CommandName. ex

if(e.CommandName =="cmdDetails")

Code to Execute.....

to find other controls inside, just use FindControl.

TextBox txtFile = (TextBox)GView.Rows[e.RowIndex].FindControl("txtFile");

John Bhatt
Glad to Know, Free to Share.....

Sashys, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response