Find Parent of Control by Name

user2025830 picture user2025830 · Mar 4, 2013 · Viewed 17.3k times · Source

Is there a way to find the parents of a WPF control by its name, when the name is set in the xaml code?

Answer

Arun Selva Kumar picture Arun Selva Kumar · Mar 4, 2013

Try this,

element = VisualTreeHelper.GetParent(element) as UIElement;   

Where, element being the Children - Whose Parent you need to get.