ListView has a list of ListViews, how to clear out all list data and entries

Hi all…

UE 5.2.

I have a list view that is driven by a structures. This is not the exact data or type, but this is the gist of what is going on.

USTRUCT
struct CarModel
{
FString carModelName;
}

USTRUCT
struct CarManufacture
{
FString manufactureName;
TArray carModels;
}

USTRUCT
struct CarManufactureList
{
TArray carManufacturers;
}

So, I need to display this data, and the way I am doing it is using ListViews.

I have an outter list view that displays the list of car manufactures.
Each car manufacture has it’s own list of car models that gets displayed in it’s own list…

So basically, a list of lists.

Everything populates just fine in my listview of listviews. However, when a button in pressed, I need to re-query my data source to pull back fresh data.

How do you properly destroy all the list items in every list when not all items are visible. My understanding is that on a ListView->ClearListItems() only clears out what is visible. However, there is still a LOT of data not being shown.

Also, For each parent list at the top level, how do I get at each sublist object so that I can call it’s ClearListItems()

Considering that I am really recreating everything anyway, would it be terrible to nullify the main outter ListView, and then on the fly, regenerate a completely new ListView and all it’s child ListViews?

It seems like there would have to be a more elegant approach that bruit force.

Any help will be greatly appreciate!!!

Thanks.