I can’t seem to find any clear instruction on how I can display an array of stucts in a list view.
My array is in the game instance and I want to display a field from the struct in a list view. I have created both the list view and list view entry widget blueprints and have interfaced them.
I thought it would be a simple case of looping through the array and updating the text of each entry widget but it only displays the last entry.
HI @Nortksi ,
From what I’ve looked into, I think the issue with your code is that the array is being used incorrectly inside the Entry. Each Entry in the ListView is supposed to receive a single instance of data , and render itself with that in On List Item Object Set.
If instead you pass the entire array into the Entry and loop over it there, you’ll just keep overwriting the same TextBlock multiple times, and only the last value ends up showing.
Here are a couple of guides/tutorials that explain the proper setup:
Hey, thanks for replying.
I managed to figure it out in the end. I needed to create another class to hold a list entry from the array and construct it each time within the loop and pass this object into AddItem..
My understanding is then the AddItem function calls the OnEntryInitialized event and that’s where the data can be accessed from.