4-26 Dynamically add widget to grid layout

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

1 Like

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

2 Likes

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.

1 Like