Quick-Start guide to List View widget

This post is intended to be a quick-start guide to get List View up and running with simple add, edit, and remove functionality. For more advanced stuff, you may have to find another forum post to help with that.

None of this will be groundbreaking information, it’s mostly information that me, from 2 weeks ago, would’ve liked to have as a reference when first getting into all of this.

This only applies to List View and Tile View

I have not experimented with Tree View, but maybe I’ll try working with it in the future.


First, we need to create a few things:

  • Our widgets (ListEntry & List View)
  • Our data (Structure_Example)
  • Our data representation (Object_Example)

The Object_Example is what we will be adding to our list to carry the data we want to be shown in the widget

content browser example 1

Populate your structure with data you want to show in the list entry,
structure example 1

then add it as a variable to our object.
object example 1

Remember to check Instance Editable & Expose on Spawn so we have an exposed pin on the Construct Object from Class when the time comes.


Let’s move on to the List Entry

list entry example 1

We need to add the UserObjectListEntry interface to the list entry for it to be usable.
Widgets example 2

Implement the event On List Item Object Set in the list entry,
Widgets example 5

then we can cast to our object and save it as a variable.

It’s very important to only save the Object_Example variable and NOT the Structure_Example_Var variable.
If the list entry widget referenced the Structure_Example_Var as a separate variable, it won’t update values beyond the initialization unless we manually call Regenerate All Entries.

But as long as we bind the widget elements from the Object_Example variable, the widget will update automatically.


Let’s move to the List View

Because we added the UserObjectListEntry interface to the list entry, it’s now available in the entry widget class of the list view.
list view example 1

Now we can add the list view widget to the viewport and start adding objects to it!


I’ll be working in a Player Controller blueprint to add, edit, and remove list entries since I have a reference to the list view variable there already. However, this may need to be done differently depending on how you already have your blueprints set up.

Add an Entry to the List View

Construct Object_Example and set its Structure_Example_Var variable, add it to an array to reference later, then add it to the list view widget.

Edit an Entry in the List View

We get from our array of objects and Set Members in the object’s structure variable. This updates the list entry without the need to refresh the entire list.

Remove an Entry from the List View

We get from our array of objects and remove the object from the list view, then we remove the object from our array.


And there we have it!

A functioning list view that can add, edit, and remove entries.

If there’s anything major that I missed, I hope that you let me know.

28 Likes

Hi Mad_Moth126, thanks for this Quick-Start guide it definitely helped me to get my list view setup without too much trouble.

I’d just like to add for others that I ran into issues with the way that List View displays the List Entry. Originally I setup my ListEntry using a Canvas Panel but that resulted in the List View shrinking my List Entry to the point that it was barely visible.

Instead I recommend making sure to setup your ListEntry using vertical and horizontal boxes, the List View will still attempt to shrink your List Entry but it won’t be as bad and if you manually add in padding to your elements within the vertical and horizontal boxes you can stop any shrinking from occurring.

I’m hoping there is a better solution to this problem, so would appreciate any tips.

2 Likes

Thank you so much for this guide! :slightly_smiling_face:

It helped IMMENSELY in our project.

Excellent tutorial, I was losing my mind over this.

If you ever figure out Tree View please update this. I’m currently trying to fake a Tree View by using a border to indent the object, and rebuilding the list any time an expandable item is clicked.

Thank you so much, this was incredibly helpful, honestly.

Thankyou for this. The Unreal docs are appalling and this was a great help. You are a real hero.