GridView & Labels ?

  • Thread starter Mr. Murad Jamal
  • Start date
M

Mr. Murad Jamal

I have a GridView Control, I added a label to each cell,
how can i access that label from Code Behind ?

Thank you in advance !
 
J

Jan Hyde

Mr. Murad Jamal <[email protected]>'s
wild thoughts were released on Wed, 7 Jun 2006 01:08:02
-0700 bearing the following fruit:
I have a GridView Control, I added a label to each cell,
how can i access that label from Code Behind ?

Thank you in advance !

Are you talking about template fields columns?

If so then RowDataBound event you can get at your label with
code something like this

Dim lbl As Label

If e.Row.RowType = DataControlRowType.DataRow Then
lbl = e.Row.FindControl("TheNameOfTheLabelIWant")
Endif



Jan Hyde (VB MVP)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top