Hi team
i have two gridviews and a button.
in first gridview there are some rows if select that row and trigger the buuton then i should get all the details of that row.
ex:
Department------>Button----->then i should get the details of the deapartment.
should we require to create a storeprocedure or any other idea.. pls help me
Gridview
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

CrishRank #1,487 · 1.1K reputationPosted Dec 27, 2010, 12:47 AM EST
try below code
protected void btnAdd_click(object sender, EventArgs e)
{
Label lblLabelName = (Label)sender;
string lblLabelName= lblLabelName.Text;
TableCell tb = (TableCell)lblLabelName.Parent;
DataGridViewItem di = (DataGridViewItem )tb.Parent;
Label lblProductID = (Label)di.FindControl("lblProductID");
}
sandeep kodepaka97 reputationPosted Dec 27, 2010, 1:08 AM EST
The button is not for adding, it has to retrive all the records of that particular row.in to another gridview by using a button
Suthish NairRank #92 · 22.8K reputationPosted Dec 27, 2010, 10:59 AM EST
Your query resolved?
sandeep kodepaka97 reputationPosted Dec 27, 2010, 6:50 PM EST
still i'm not able to solve the problem can u pls help me.
you know the requirement right,