Get control

  • Thread starter Thread starter shapper
  • Start date Start date
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
 
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
 
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
 
Back
Top