Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a gridview in witch 5 linkbuttons in each row.
i need when i select row by griview_selectedindex() function i should be able to get the text assigned to link button
thanks
Posted

Hi ,
try this
C#
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        string linkname = ((LinkButton) GridView1.Rows[e.NewSelectedIndex].FindControl("LinkButton1")).Text;

    }

Best Regards
M.Mitwalli
 
Share this answer
 
Hey,

u can get gridview control Like this

C#
Label myLabel = (Label)myGridView.Rows[myGridView.SelectedIndex].Cells[2].FindControl("myLabel");


hope this will help u
 
Share this answer
 
v2

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