Mathematical algorithm for transferring grid cells

Hello answerhub, here is the problem:

I’m setting a grid panel’s horizontal rows(or collumn’s i think) and every N number of cells the panel must go down by and continue setting from new line.

It’s the first time i’m working with umg so show me pls some ways to implement this algorithm in detail. I can’t clearly understand what to do with the number of number of required cells in a row.

Thank you for your time!

tl;dr: take advantage of modulo.

or have a look here:

What do you mean?


Follow the link I sent to see it in action. Or the quick pic to save you a click: