Get control

S

shapper

Hello,

I have a control inside a custom control. The control tree is has
follows:

ListView > EditItemTemplate > CustomControl A > CustomControl B >
Literal

I need to bind the Literal so I did the following:

Dim lvdiContainer As ListViewDataItem =
CType(myLiteral.NamingContainer, ListViewDataItem)

This does not work because myLiteral.NamingContainer returns Custom
Control B.

If I have the following control tree it works:

ListView > EditItemTemplate > Literal

Could someone, please, tell me how to solve this problem?

Thanks,
Miguel
 
J

Jon

Hello,

I have a control inside a custom control. The control tree is has
follows:

ListView  >  EditItemTemplate > CustomControl A > CustomControl B >
Literal

I need to bind the Literal so I did the following:

Dim lvdiContainer As ListViewDataItem =
CType(myLiteral.NamingContainer, ListViewDataItem)

This does not work because myLiteral.NamingContainer returns Custom
Control B.

If I have the following control tree it works:

ListView  >  EditItemTemplate >  Literal

Could someone, please, tell me how to solve this problem?

Thanks,
Miguel

Hello Miguel,

Could you set the value of your litreral from within Control B. For
example on the OnLoad or PreRender event?

Jon

www.nantwichonline.com
 
S

shapper

Hello Miguel,

Could you set the value of your litreral from within Control B. For
example on the OnLoad or PreRender event?

Jon

www.nantwichonline.com

Hi,

I can't do that. This is inside a ListView Item template.

I tried the following:

Dim lvdiContainer As ListViewDataItem =
CType(lText.Parent.Parent.NamingContainer, ListViewDataItem)

I keep having the same error.

Thanks,
Miguel
 

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,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top