Skip to main content

Microsoft Silverlight

Answered Question how to get ListBoxItem's parent ListBox?RSS Feed

(0)

TBink
TBink

Member

Member

254 points

188 Posts

how to get ListBoxItem's parent ListBox?

How do you (easily) get the parent listbox of a given listboxitem within that listbox.  I know there are other ways to establish that relationship but I specifically want to know if there's a way something like

 Listbox lstbx = mylistboxitem.getLogicalParent();

 Parent only get the stackpanel within the ListBox assemblage

Yi-Lun Luo - MSFT
Yi-Lun L...

All-Star

All-Star

25052 points

2,747 Posts

Answered Question

Re: how to get ListBoxItem's parent ListBox?

Unfortunately there's no logical tree in Silverlight... But if your ListBox is not in a template, I mean when Visual Studio can generate a instance such as ListBox listBox1 in code behind, you can simply reference to that instance.

shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities