how to find control in headertemplate of datagrid

  • Thread starter Thread starter Cheng
  • Start date Start date
C

Cheng

hi
i have adding a label in the headertemplate of a datagrid
i have write the code to find it;

//my code
Label lbl = (Label) DataGrid1.FindControl("myLabel");

but i can't find it
what is the right method that i can find it?

thank you :P
 
Try iterating thru the DataGridItems in your datagrid and use the DataGridItem.FindControl("idofyourcontrol") method to find your label control.

Suresh

----- Cheng wrote: ----

h
i have adding a label in the headertemplate of a datagri
i have write the code to find it

//my cod
Label lbl = (Label) DataGrid1.FindControl("myLabel")

but i can't find i
what is the right method that i can find it

thank you :
 
Back
Top