How to sort verticalbox with several vertical boxes inside

Hello forum! I have a problem regarding widgets and how to sort them. I have a vertical box, with several vertical box children. These boxes also have two children, namely text. These two texts will represent a name, and a number.
My question is this: How can I sort these boxes, and put the value of the highest child box at the top of the list.
Many thanks!

I’m not sure if you can sort children of a Vertical Box, at least not in blueprints. However, if you call AddChild to the VerticalBox and set one of the TextBlocks as child, it will be placed at the bottom of the VerticalBox. So you can call AddChild with all of the TextBlocks starting with the one containing the highest number, and they will be sorted.

1 Like

Alright! Thank you, I will try this.

You can put the existing widgets in an array, sort the array as you see fit and re-add to the container. This can be done without clearing it first.

1 Like

Oh really? I am currently trying something different, namely getting the value of the numbers inside the widget, making that into an array, then sorting that array. However that doesn’t help my current predicament, of sorting the boxes on the screen (Maybe I can give a value to those vertical boxes and then sort them during runtime?) .
This is what I currently got:

Also, adding child during runtime had a very strange effect of removing the child instead of adding it…? (I am truly losing my mind)


bild
bild

Ah yes! I managed to get it to work thanks to this solution! Thank you very much.