all groups > asp.net > february 2004 >
You're in the

asp.net

group:

how to find control in headertemplate of datagrid


how to find control in headertemplate of datagrid Cheng
2/28/2004 10:33:01 PM
asp.net: 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


RE: how to find control in headertemplate of datagrid Suresh
2/29/2004 9:21:06 AM
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 :



AddThis Social Bookmark Button