# 4-26 Dynamically add widget to grid layout

**URL:** <https://forums.unrealengine.com/t/4-26-dynamically-add-widget-to-grid-layout/504484>\
**Category:** UI\
**Tags:** ue4-editor, unreal-engine, UE4-27, question\
**Created:** [March 6, 2022, 4:34pm UTC](https://forums.unrealengine.com/t/4-26-dynamically-add-widget-to-grid-layout/504484 "2022-03-06T16:34:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zulhuky](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zulhuky](https://forums.unrealengine.com/u/Zulhuky)\
**Post date:** [March 6, 2022, 4:34pm UTC](https://forums.unrealengine.com/t/4-26-dynamically-add-widget-to-grid-layout/504484/1 "2022-03-06T16:34:28Z")

</div>

Hello!

I’m trying to make an inventory system.  
I have a grid panel, which is my inventory. And I have a widget blueprint called “inventoryItem”, which is basically an thumbnail.  
I want to add at runtime inventory items to my grid panel. But I don’t know how to do that, I did not find a way to get a reference to my grid panel, so I could add inventory items as children to my grid panel. I did not find anything relevent in the documentation or in unreal, but I probably missed something because it’s pretty basic

---

<div class="post-metadata">

**Author:** ![Zulhuky](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zulhuky](https://forums.unrealengine.com/u/Zulhuky)\
**Post date:** [March 6, 2022, 4:43pm UTC](https://forums.unrealengine.com/t/4-26-dynamically-add-widget-to-grid-layout/504484/2 "2022-03-06T16:43:00Z")

</div>

I just found out, I can check “IsVariable” in the Detail panel of my grid panel.

---

<div class="post-metadata">

**Author:** ![HAF-Blade](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/haf-blade/32/88718_2.png) [@HAF-Blade](https://forums.unrealengine.com/u/HAF-Blade)\
**Post date:** [March 6, 2022, 5:16pm UTC](https://forums.unrealengine.com/t/4-26-dynamically-add-widget-to-grid-layout/504484/3 "2022-03-06T17:16:55Z")

</div>

In the layout view select your grid layout and mark it it as a variable by either clicking on the eye-button or by selecting the checkbox in the upper right corner.

Aftwerwards it is a variable in the widget blueprint.
