how to get text of a control in itemtemplate of gridview

  • Thread starter Thread starter Dinu
  • Start date Start date
D

Dinu

Hi

how to get text of a control in itemtemplate of gridview and
how can we access and set it properties dynamycally??

Thanks
 
Hi

how to get text of a control in itemtemplate of gridview and
how can we access and set it properties dynamycally??

Thanks

You can use the FindControl() method

Sample code:

foreach (GridViewRow r in GridView1.Rows)
{
string tb = ((TextBox)r.FindControl("TextBox1")).Text;
}
 
You can use the FindControl() method

Sample code:

foreach (GridViewRow r in GridView1.Rows)
{
string tb = ((TextBox)r.FindControl("TextBox1")).Text;



}- Hide quoted text -

- Show quoted text -

hi

i have a gridview and a linkbutton in itemtemplate of that gridview,
and the linkbutton is bounded to database.
now what i want is when a user click on linkbutton i want to navigate
accordingly
to the text of linkbutton and i dont want to use select column, so how
can i find that
which linkbutton is clicked??

please help me in this scenario

Thanks & Regards
 
Back
Top