# How to get parent widget?

**URL:** <https://forums.unrealengine.com/t/how-to-get-parent-widget/372249>\
**Category:** UI\
**Tags:** unreal-engine, Widget, Blueprint, question\
**Created:** [October 2, 2016, 7:22pm UTC](https://forums.unrealengine.com/t/how-to-get-parent-widget/372249 "2016-10-02T19:22:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vvoz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vvoz](https://forums.unrealengine.com/u/Vvoz)\
**Post date:** [October 2, 2016, 7:22pm UTC](https://forums.unrealengine.com/t/how-to-get-parent-widget/372249/1 "2016-10-02T19:22:00Z")

</div>

I have two widget blueprints - Container and Element. Container consists of several panels with Elements on them.  
I’m trying to access Container instance from Element. GetParent returns the panel from Container, but if II try to get that panel’s parent I sadly get null.  
So is there a proper way to access parent User Widgets?

---

<div class="post-metadata">

**Author:** ![mdonge](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mdonge](https://forums.unrealengine.com/u/mdonge)\
**Post date:** [October 2, 2016, 7:40pm UTC](https://forums.unrealengine.com/t/how-to-get-parent-widget/372249/2 "2016-10-02T19:40:10Z")

</div>

I had touble too with that, so my solution was to add a variable reference in the child with the parent value, and set it when the child widget is added … I don’t know if it can help you, and I have only some childs, it may be memoryvorous if they are many …

---

<div class="post-metadata">

**Author:** ![Vvoz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vvoz](https://forums.unrealengine.com/u/Vvoz)\
**Post date:** [October 2, 2016, 11:04pm UTC](https://forums.unrealengine.com/t/how-to-get-parent-widget/372249/3 "2016-10-02T23:04:45Z")

</div>

Yes, that works, thanks.  
Another way I found to get communication working is to add a dispatcher to Element and bind an event to each instance in Container.  
This is somewhat more flexible but just as much bulky.  
It would’ve been much easier if there was an easy way to iterate through widget tree or to share a dispatcher between all instances of a widget…

---

<div class="post-metadata">

**Author:** ![madeesse](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@madeesse](https://forums.unrealengine.com/u/madeesse)\
**Post date:** [October 2, 2020, 12:35pm UTC](https://forums.unrealengine.com/t/how-to-get-parent-widget/372249/4 "2020-10-02T12:35:09Z")

</div>

It works well,thx

---

<div class="post-metadata">

**Author:** ![AnteIvnif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AnteIvnif](https://forums.unrealengine.com/u/AnteIvnif)\
**Post date:** [August 15, 2022, 3:23pm UTC](https://forums.unrealengine.com/t/how-to-get-parent-widget/372249/5 "2022-08-15T15:23:29Z")

</div>

Maybe someone else will need it. The parent widget can be obtained using “self → getParent → GetOuterObject-\> GetOuterObject”. You may need to use GetOuter several more times to get the desired widget.

---

<div class="post-metadata">

**Author:** ![Jynk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jynk/32/632986_2.png) [@Jynk](https://forums.unrealengine.com/u/Jynk)\
**Post date:** [March 16, 2023, 3:28pm UTC](https://forums.unrealengine.com/t/how-to-get-parent-widget/372249/6 "2023-03-16T15:28:36Z")

</div>

Alo, This post is old but I made a macro that should do this. I’m sure it can be improved though.  
In the case of the two ‘get outer objects’, the widget components outer object is the widget tree, so you gotta do it twice.

 ![get ancestor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/b/02bc1b38f39a6dd7453b4b44a21d36b5325d901f.jpeg)

---

<div class="post-metadata">

**Author:** ![johnsu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@johnsu](https://forums.unrealengine.com/u/johnsu)\
**Post date:** [June 30, 2023, 1:34pm UTC](https://forums.unrealengine.com/t/how-to-get-parent-widget/372249/7 "2023-06-30T13:34:57Z")

</div>

You made my day.

---

<div class="post-metadata">

**Author:** ![Codingrocks3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Codingrocks3](https://forums.unrealengine.com/u/Codingrocks3)\
**Post date:** [August 24, 2023, 4:15am UTC](https://forums.unrealengine.com/t/how-to-get-parent-widget/372249/8 "2023-08-24T04:15:11Z")

</div>

So will this widget continue to check each time? Shouldn’t this check the outer objects one by one?

---

<div class="post-metadata">

**Author:** ![N\_K\_Poling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@N\_K\_Poling](https://forums.unrealengine.com/u/N_K_Poling)\
**Post date:** [October 4, 2024, 7:06pm UTC](https://forums.unrealengine.com/t/how-to-get-parent-widget/372249/9 "2024-10-04T19:06:33Z")

</div>

![Screenshot 2024-10-04 140448](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/e/6/ae6889dc5e8ef3317b42d5222ae7088f3a7c54dc.jpeg)

Using what was mentioned above I created a function that keeps cycling through parent objects until the desired ones are found hope this helps
