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:

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/114105-uniform-grid-panel-setup

modulo?
What do you mean?

316727-screenshot-2020-10-01-100123.jpg

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