Separate elements in a ui grid

Hello. I would like some help on a UI-related problem.


In this example I drew say these yellow and gray boxes are frames in a UIGridLayout. I need my script be able to to separate the yellow boxes and the gray boxes so that the yellow ones should appear first.

So the yellow box at the very end should join the rest of the yellow boxes at the start.

This can be achieved by using the LayoutOrder property, which dictates the order of frames within layouts (such as the UIGridLayout you are using).