UMG Problems List View text

Am trying to use List View and Grid in UMG.
Am trying to make a basic inventory, and since drag and drop is not supported yet AFAIK.
I am trying to use the list view but cant for the heck of it figuer out how to add basix text to rows and colums.

Anyone have any experience with this?

Hi there!

I hope you figured out your problem. I too had the same question, but couldn’t find a really good answer on how to use the ListView widget. I looked at some of the code and figured it out! 's how it works.

  • You add a ListView widget to your UMG, make it a variable (in this case, I’ll call it MyListView)
  • At some point in time (construction, certain event, setter, etc.) you make an array of Objects and call MyListView’s SetItems function (passing in your array of objects).
  • Now, 's where it gets a little tricky. For each one of those Objects passed in, it’s going to call MyListView’s On Generate Row Event binding (See the Events rollout in the designer).
  • That Event Binding from above must return a Widget that will then be used for the ListView. You get the object in as a parameter, so it’s easy to pass around data with some simple casting.
  • For the handler above, you can use Create Widget like you do any other UMG! Just make sure to return it from this event.

Hope this helps someone! I’ll make a wiki entry about it!

1 Like

How are you creating that widget and passing text to it?

First I create a UMG Blueprint of my List Item (in this case, it can just be a Text Block as the root of the hierarchy). Bind its Text to some property or function.

In the steps above, in your Generate Row Event binding, you would call Create Widget with the UMG blueprint class (from above) specified. Cast it to your concrete blueprint, then set the property for the text. You would then use this widget as a return value.

Thank you for the answer, i never got ListView to work.
So am going to try this right away, I started using the Grid one and am fast understanding that i need to learn a lot about UMG.

Before i can be effective with it.
Atleast now i got my derived class of UUserWidget compiled so i can look at/ use it in code as well :slight_smile:

Cheers!