setting control properties based on another control

I

Iams

I have a grid, a label within the grid, and another grid within the grid. I
want the label to be the same size as the child grid, how would I do this?

I tried putting the following code in the dg_ItemCreated event, but the 2nd
grid hasn't been created yet so I get an object doesn't exist error. I also
tried putting it at the end of the page load event, but it would not find
the control.

Dim l As Label

l = CType(e.Item.FindControl("Label2"), Label)

If Not (l Is Nothing) Then

try

l.Width = dgChild.width

catch

end try

End If
 

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,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top